About This Accessibility Rule
Each form element must have a label element attached with it programmatically.
Forms must have effective form labels in order to be accessible. Form elements like as checkboxes, radio buttons, input fields, etc. are frequently self-explanatory to sighted users, even if they are not programmatically labeled. Users with screen readers require descriptive form labels to identify form fields. Adding labels to all form elements removes uncertainty and makes the product more accessible.
When form elements lack labels, screen reader users are unaware of the expected data input. Screen readers cannot determine information about input items programmatically in the absence of an established label association (or redundant text functioning as a label).
Since clicking the label activates the control, people with weak motor control do not benefit from a bigger clickable area for the control.
What this Accessibility Rule Checks
Ensures that each form element has a label associated with it programmatically.
Learn more:
- → Deque University - How To Fix
- → W3C WAI - Labeling Controls
- → WCAG 2.1 - Failure of Success Criterion 4.1.2 due to a user interface control not having a programmatically determined name
- → WCAG 2.1 - Using label elements to associate text labels with form controls
- → WCAG 2.1 - Using aria-labelledby to provide a name for user interface controls
- → WCAG 2.1 - Using aria-label to provide an invisible label where a visible label cannot be used
- → WCAG 2.2 - Using the title attribute to identify form controls when the label element cannot be used
Detect accessibility issues automatically
Rocket Validator scans thousands of pages with Axe Core and the W3C Validator, finding accessibility issues across your entire site.