Title attribute to identify controls [H65]
Test infoPossible Results
Test info
About
Short Description
How to Repair
Add a label element and associate it with the form control by referencing the id of the control as the value of the for attribute of the label.
The text of the label should describe the purpose of the contol unambiguously. For radio buttons and checkboxes place the label after the form control, for all others place the label before the form control.
Further information: Accessible HTML/XHTML Forms: Intermediate Level
Note: It is also possible to name form controls with their title attribute, but this practice is not recommended and should only be applied if there is no room for a label element in the layout.
WCAG 2.0
- Principle 3: Understandable
-
Information and the operation of user interface must be understandable.
WCAG 2.0: Principle 3 - Guideline 3.3: Input Assistance
- Help users avoid and correct mistakes. Understanding Guideline 3.3
- Success Criterion 3.3.2: Labels or Instructions (Level A)
-
Labels or instructions are provided when content requires user input (Level A).
Understanding: Success Criterion 3.3.2 - Techniques
Possible Results
- Duplicate title attribute for form controls
-
The input element of type radio, checkbox, file, text or password, the select element or the textarea has a duplicate title attribute
- The form control has an empty name
-
The input element of type radio, checkbox, file, text or password, the select element or the textarea has a empty title or empty associated label.
- The form control has no name
-
The input element of type radio, checkbox, file, text or password, the select element or the textarea has no title and no associated label.
- The form control has a name
-
The input element of type radio, checkbox, file, text or password, the select element or the textarea has a non-empty title or associated label.