Title attribute to identify controls [H65]

Test info
Possible Results

Test info

Test for Success Criterion 4.1.2

About

Checked Elements: input[@type='radio'], input[@type='checkbox'], input[@type='file'], input[@type='text'], input[@type='password'], select or textarea elements
This test checks, if a name for the form control is provided by an associated label or its title attribute.

Short Description

The name of an input element of type radio, checkbox, file, text or password, a select element or a textarea is provided by its associated label element or its title attribute. This text provides a name for the form control so users are able to understand its purpose and can decide what to insert or select.

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

Failed 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

Failed 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.

Failed 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.

Passed 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.