WebAIM - Web Accessibility In Mind

E-mail List Archives

RE: Labeling form elements for date

for

From: Terence de Giere
Date: Jun 27, 2002 2:43PM


The LABEL element may not be nested as in the example:

<label for="month"><label for="day"><label for="year">Select the
date:</label></label><label>

One may however nest the related INPUT within a single LABEL element
which creates an implicit association of a LABEL with a forn control:

<label for="month">Month:
<input id="month" name="month" type="text" size="2" maxlength="2" >
</label>

Note that older assistive technology does not support the explicit
association provided by the "for" attribute, and placing the LABEL text
immediately before the associated form control is the best way to make
sure a user will understand they go together. If the LABEL element