Labels for Form Controls Rules
HTML Markup Details
labelelement forinput[type="text"],input[type="password"],selectandtextareaelements- The primary way to provide an effective label for a form control is to use the
labelelement using theforattribute to reference theidattribute of the form control. Thelabelelement can also encapsulate form controls, but this technique has problems with many types of assistive technogies. valueattribute forinput[type="button"],input[type="submit"]andinput[type="reset"]- The
valueattribute, defined ininputelement, should provide an effective label forinputelements with thetype="button",type="submit"andtype="reset". altattribute- The
altattribute, should provide an effective label forinputelements with thetype="image". - If the
labelelement content includes animgelement, thealtattribute of theimgelement will be part of the effective label. buttonelement- The text content of the
buttonelement is an effective label; if thebuttonelement content includes animgelement, thealtattribute value of theimgelement will be part of the effective label. titleattribute- The
titleattribute, supported by most form control elements, is the secondary way to provide an effective label for html form controls. When a set of form controls are laid out in columns or rows, the appropriate effective label for several controls should be at the beginning of the row or the top of the column. fieldsetandlegendelements- The
fieldsetandlegendelements are used to add grouping information to effective labels for a group of related html form controls. tabindexattribute- The
tabindexattribute can be used to make important information related to the form, e.g. instructions, part of the TAB navigation order.
Definitions
- Effective Label
- The effective label of a form control is the text content communicated to assistive technologies to identify the purpose of the form control on a web page. Effective label is critical in order for users of assistive technologies, especially screen reader, to have meaningful labels that will inform them the purpose of the form control.
- When effective label for a form control is not defined in the mark up, assistive technologies try to guess an effective label based on the position of text that is near the form control. This leads to forms that are difficult or impossible to complete since the effective label content will be incomplete or misleading.
- The effective label of a form control is calculated from the content from one of the following sources:
label,button,input.title,input.altandinput.value. The calculation can also include content from thelegendelement andimg.altattribute ofimgelements contained inlabelandbuttonelements. The text of the effective label should be meaningful and uniquely identify the purpose of the form control. For more information on the calculation of the effective label, view description under Accessibility Evaluation Rule #5.
Accessibility Evaluation Rules
| no. | FAE 2007 | FAE 2008 | Description |
|---|---|---|---|
| 1 | N/A | Pass/Fail | The elements
Implementation Information
|
| 2 | N/A | Pass/Fail | The element
Implementation Information
|
| 3 | N/A | Pass/Fail | The elements
Implementation Information
|
| 4 | N/A | Pass/Fail | Each Implementation Information
|
| 5 | N/A | Pass/Warning | Each effective label within a web page should be unique. Implementation Information The calculation of effective label primary content:
Note: If more than one primary source of content is defined for a form control element, only one of the sources will be used for the pimrary content and other sources will be ignored. The possible primary sources in the above list are in the same order as the order of precedence. effective label modifications:
|
| 6 | N/A | Pass/Check | Text content that cannot receive the focus should not be placed between form controls.
|
| 7 | N/A | Pass/Check | The elements
|
| 8 | N/A | Check | Required form controls should have the word "required" as part of the effective label.
|
| 9 | N/A | Check | Invalid form controls should have the word "invalid" as part of the effective label.
|
| 10 | N/A | Check | When content of a form is validated as the user submits the form, a response page should follow that provides a list of links with each link text describing the problem each invalid form field of the form has:
|
| 11 | N/A | Check | When content of a form is validated as the user fills out each form field, an alert box must indicate if the input is invalid as the user tries to move the focus to the next form control. |
| 12 | N/A | Check | Ensure that form fields are in a logical tabbing order.
|
| 13 | Pass/Fail | N/A | Each form control label within a web page must have an associated label element. |
FAE Rule Implemetation
- FAE 2007
- The Illinois Functional Accessibility Evaluator (FAE) currently implements FAE 2007 rules.
- The Illinois Firefox Accessibility Extension currently implements these rules.
- FAE 2008
- The FAE 2008 rules are designed to optimize the rules for implementation of Section 508, W3C User Agent Accessibility Guidelines and Illinois Information technology Accessibility Act requirements and are based on the requirements of these standards and experience with the problems of FAE 2007.
- Illinois Functional Accessibility Evaluator Implementation of FAE 2008 rules is currently under development.
- The Illinois Firefox Accessibility Extension currently implements some of these rules.
