W3C home > Mailing lists > Public > w3c-wai-gl@w3.org > October to December 2001

form controls: mandatory status

From: Mirabella, Mathew J <Mathew.Mirabella@team.telstra.com>
Date: Fri, 7 Dec 2001 15:35:34 +1100
Message-ID: <73388857A695D31197EF00508B08F298061E2F7C@ntmsg0131.corpmail.telstra.com.au>
To: "'W3C WAI Web Content Accessibility Guidelines list'" <w3c-wai-gl@w3.org>

A query and item for discussion.  How to indicate the mandatory status of
form controls to users in a visual and non-visual way.

An example:

	<p>* indicates mandatory field</p>...
	Username: <input type="text" value="" size="30"> *

We must include the <label> for the form control.  (Also a number of other
accessibility features like tabindex and accesskey).

	<p>* indicates mandatory field</p>...
	<label for="username">Username:</label> <input name="username"
id="username" type="text" value="" size="30" tabindex="1" accesskey="u"> *

(A * is a common way of indicating mandatory status.  Any views on where the
* should be located with respect to the form control?  before/after or  near
the label/etc.?)

How do we indicate mandatory status clearly to users of screen readers and
other technologies without having extra text on the screen aside from the *?
I would like to see an attribute that can be used by technologies, like
status="mandatory" for <input> elements.  Maybe there is one, and I have not
heard of it.  (I know of a status property, but I think this is a different

What do you all think of using a span element in the following way?

	<p>* indicates mandatory field</p>
	<span style="position: absolute; top:0px; left:0px; z-index:1;
	<label for="username">Username. Mandatory field</label>
	<input type="text" value="" size="30" name="username" id="username"
tabindex="1" accesskey="u"> *

This hides the text "username, mandatory field".  The contents of <label> is
still immediately before the form control (albeit in a span), and the screen
displays the usual text "Username" with the *.  Jaws 3.71 with IE 5.5 reads
"username, mandatory field edit" only when in forms mode at this form field
because it is the contents of the <label> element, despite the fact that it
is in the hidden span.

It looks like a clever hack, but it seems to work well.  Has anyone
encountered this kind of work-around before?  if so, does anyone know if it
works with other combinations of browsers and  adaptive technologies?  I
imagine that this sort of hack would be a bit problematic.

What do you all think?



Mat Mirabella
Telstra Research
03 9253 6712
Received on Thursday, 6 December 2001 23:36:45 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 16 January 2018 15:33:39 UTC