|
|
|
|
|
Web Accessibility: FormsAssociate Form Controls and LabelsUsers with visual impairments may not be able to determine which label applies to which form control and therefore will not know what data to enter. Proper positioning of the label helps to avoid this.
For each form control, place its label in a <LABEL>. A label is attached to a specific form control using the FOR attribute. The value of the FOR attribute equals the value of the ID attribute. For example:
<LABEL FOR="firstname">First Name:
<INPUT type="text" id="firstname" tabindex="1">
</LABEL>
produces the following:
Labels Should Appear After a Radio Button or CheckboxFor example:
<input type="radio" name="button" value="Personal Development" id="dev">
<LABEL FOR="dev">Personal Development</LABEL>
<input type="radio" name="button" value="Management Skills" id="skills">
<LABEL FOR="skills">Management Skills</LABEL>
produces the following:
Labels for Text Fields Appear Before the Text FieldFor example:
Labels for Groups of Form Controls Appear Before the GroupFor example:
Poway
Sacramento Make sure that the <LABEL FOR=> is right next to the identifying text as any formatting will not allow this to work properly with assistive computer technology (or some browsers).
Do not forget to close off the label tag with a </LABEL> after the identified text. As a result of this coding, a screen-reader will report back the "Choose a city:" information whenever the user moves the focus from one radio button to the next radio button. This provides additional feedback in order to move through the form. Use <OPTGROUP> to Group Lists of SelectionsNote: HTML 4.0 does not permit nested <OPTGROUPS>. While a future version may add this capability, it is advisable to create only a single grouping level with this element.
For example:
produces...
Use <LEGEND> to label each <FIELDSET>For example:
|