Labels for Form Input Controls

The correct labeling of input controls on forms is typically the most important accessibility concern of the widget developer. A visually impaired user may use a screen reader to access the application. A screen reader is a software application that converts the text of a web page (or other application) into speech, allowing the user to hear what is present and respond appropriately. When using a form, the screen reader will inform the user of the input control that currently has the input focus. For example, the user may use the Tab key to move the focus to the text field with the label Date of Birth and the screen reader will announce "Date of Birth, edit"; adding the word "edit" to notify the user that the control is editable. This is only possible if the screen reader can associate the label of the field with the input control for that field.

All of the accessibility standards require that input controls on forms be identified by labels that can be used by a screen reader. The implementation guidelines for these standards often demonstrate the use of the HTML label element that allows the label text to be marked up with an element that defines the ID of the input control for which that text is the label. Some validation tools then enforce this particular implementation guideline to the exclusion of all others. The CDEJ does not use the HTML label element to associate label text with form input controls, it uses an alternative method. The HTML of a Cúram application page may fail an automated accessibility validation check for this reason, but this failure is erroneous and does not affect the accessible of the form input controls to a screen reader application.

The technique used by the CDEJ is the same technique that widget developers should use. The visible label of the input control is rendered separately and automatically by the CDEJ and the title attribute of the input element is set to the value of the label that should be read by the screen reader for that control. There are several reasons why this approach is used by the CDEJ instead of the often suggested label element:

These are the main reasons why the CDEJ uses and recommends the title attribute in preference to the label element. The application pages are equally, if not more, accessible to screen reader applications and users as a result. Any spurious errors from accessibility validation tools relating to the non-use of the label element can be safely ignored once the presence of the title attribute has been confirmed.