Rule FORM-2
The elements input[type="text | password | checkbox | radio | file"], select and textarea must have labels.

Description

Best Practice Type: Pass/Fail

The elements input[type=“text | password | checkbox | radio | file”], select and textarea must have:
# label element content that has the label.for attribute referencing the id attribute of the form control element, or
# title attribute content on the form control element itself.

Notes

  • If both label element and title attribute are specified, the label element will override the title attribute.
  • Each label element must reference an id attribute on the page.
  • Each id attribute value of a form control element within a page must be valid and unique.
  • The label element should not encapsulate input[type=text], input[type=password], select and textarea elements. The text child nodes of a textarea element content that the user entered and option element content of a select element will be included as part of the effective label.
  • For pages with densely packed form controls, label elements can be hidden from the visual rendering using CSS techniques of absolute positioning. (Ex. Date picker using hidden labels.)
  • The use of the title attribute as the label of a form control should generally be avoided, but may be useful in cases where form controls are densely packed and the use of visually rendered or hidden label elements is inconvenient, or where the label information is useful as a tooltip.

Markup

none

Associated Accessibility Guidelines and Standards

Guideline or
Standard
Requirement Priority Test
Type
IITAA 10.1 Provide labels or titles for all form fields. Required Violation
Section 508 1194.22 (n) When electronic forms are designed to be completed on-line, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues. Required Violation
WCAG 1.0 12.4 Associate labels explicitly with their controls. Required Violation
WCAG 2.0 1.3.1 Info and Relationships Required Violation

Examples

Evaluation Techniues

Testsuite Tests