Ensuring ARIA Input Fields Have Accessible Names
Rule ID: aria-input-field-name
Ruleset: axe-core 4.10
User Impact: Serious
Guidelines: WCAG 2.1 (A), WCAG 2.0 (A), WCAG 2.2 (A), Trusted Tester, EN 301 549
How to Fix the Problem
ARIA input fields such as those using role="combobox"
, listbox
, searchbox"
, slider"
, spinbutton"
, and textbox"
must include an accessible name that can be identified by assistive technologies like screen readers.
Use One of the Following Markup Patterns That Pass Testing:
-
Combobox with aria-label:
-
Listbox with aria-labelledby:
-
Searchbox with aria-labelledby:
-
Slider with aria-label and value attributes:
-
Spinbutton with aria-label and value attributes:
-
Textbox with aria-labelledby:
Avoid These Incorrect Markup Patterns:
-
Using empty
aria-label
values: -
Referencing non-existent labels:
-
Relying on implicit labels with unsupported elements:
-
Using
label for
with div-based roles: -
Missing accessible name entirely:
Key Point: ARIA roles on elements that are not native form controls (e.g., div
) must have explicitly defined accessible names via aria-label
or aria-labelledby
.
Why it Matters
Screen reader users rely on accessible names to understand the purpose and context of form controls. Without clear and descriptive naming:
-
Users may be confused about the role or function of the element.
-
Navigation becomes inefficient or impossible.
-
The form field may be skipped altogether, leading to incomplete submissions or data entry errors.
By ensuring every ARIA input field has a programmatically determinable name, you improve the experience for assistive technology users and meet fundamental accessibility requirements.
Rule Description
This rule checks that all input fields defined with ARIA roles (combobox
, listbox
, searchbox
, slider
, spinbutton
, and textbox
) have an accessible name, making them understandable and usable by screen reader users.
The Algorithm (in Simple Terms)
-
If an element has a supported ARIA input field role…
-
Then check for the presence of a non-empty accessible name.
-
This can be provided via
aria-label
oraria-labelledby
.
If no name is present, the element fails the rule.