Techniques |
- The preferred technique for labeling form controls is by reference: First, include an
id attribute on the form control to be labeled; then use the label element with a for attribute value that references the id value of the control.
- NOTE: An alternative technique of using the
label element to encapsulate a the form control element does not fully support some assistve technologies, like speech input for activating the control.
- In special cases, the
aria-labelledby attribute can be used on the form control element to reference the id(s) of the elements on the page that describe its purpose.
- In special cases, the
aria-label attribute can be used on the form control element to provide an explicit text description of its purpose.
- In special cases, the
title attribute on the form control element can be used to provide an explicit text description of its purpose.
- EXCEPTION: When form controls are in a
table , grid or treegrid the row number and the header cells is a common practice to identify the purpose of the form control. While this technique is widely used it has not been identified as a definitive way to meet WCAG labeling requirements.
|