W3C home > Mailing lists > Public > w3c-wai-gl@w3.org > April to June 1998

RE: Explicit vs. implicit label association

From: Wendy A Chisholm <chisholm@trace.wisc.edu>
Date: Tue, 14 Apr 1998 13:05:23 -0500
Message-Id: <199804141805.NAA22606@trace.wisc.edu>
To: w3c-wai-gl@w3.org
Per today's comments and existing examples in html 4.0,  here is the proposed
new content for recommendation 8.2:

[Required]
  Associate labels with their form controls.
Labels can either be associated explicitly, using the "for" attribute,
or implicitly, by nesting the control element within the content of the
LABEL element.

[New] The "for" attribute of the LABEL element allows explicit
association. For example:
<FORM action="http://somesite.com/adduser" method="post">
  <FIELDSET>
    <LEGEND>Personal information</LEGEND>
    <LABEL for="firstname">First name:</LABEL>
    <INPUT type="text" id="firstname" tabindex="1">
    <LABEL for="lastname">Last name:</LABEL>
    <INPUT type="text" id="lastname" tabindex="2">
    ...more personal information...
  </FIELDSET>
  <FIELDSET>
    <LEGEND>Medical History</LEGEND>
    ...medical history information...
  </FIELDSET>
</FORM>

[New] Nest the control element within the content of the LABEL element
for implicit association. For example:
<FORM action="http://somesite.com/adduser" method="post">
  <LABEL>
    First Name
    <INPUT type="text" name="firstname">
  </LABEL>
  <LABEL>
    <INPUT type="text" name="lastname">
    Last Name
  </LABEL>
</FORM>

wendy chisholm
human factors engineer
trace research and development center
university of wisconsin - madison, USA
Received on Tuesday, 14 April 1998 14:05:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:46:57 GMT