The Label's for Attribute References An Element That Is Not A Form Control

Compliance Data & User Impact

User Impact: Critical

100% Complete

Disabilities Affected:

  • blindness
  • deafblindness
  • learning disablities

WCAG Version:
2

WCAG Levels:

  • A

WCAG Guidelines:

Solution Techniques:

Automated Test Accuracy:
High

Check1st Severity:
3

DRRSAG Designations:

  • description

How to Fix The Problem

Ensure that the label’s for attribute is associated with the id attribute of an element that is a form field. Use an alternative labeling (e.g. `aria-label) if a description is required for a non-form field element.

The Algorithm, In Simple Terms

The engine scans for elements referenced by a label’s for attribute, and checks whether they are an input, select or textarea elements.

Why Is It Important?

Incorrectly associate a label with a non-form field element is misleading to assistive technology users.

Code Example

<label for="name">Name</label> 
<input type="text" name="name" id="name"/>

Additional Information

Relevant Technologies: HTML and XHTML controls that use external labels