ARIA
ARIA input fields need a name
- Rule:
aria-input-field-name - Severity: Serious
- WCAG level A
Why it matters
A combobox, listbox or searchbox built from generic elements has no label of its own. Without a name it is announced by its role alone, so its purpose is invisible to anyone not looking at the screen.
How to fix it
- Point aria-labelledby at the visible label element.
- Where there is no visible label, use aria-label with the same wording the placeholder shows.
- A placeholder alone is not a name: it disappears as soon as someone types.
In markup
<div role="combobox" aria-expanded="false"></div><div role="combobox" aria-expanded="false" aria-label="Country"></div>The requirement behind it
This rule is one way of failing the following WCAG 2.2 success criteria. The W3C, which writes the standard, explains each of them:
- 4.1.2 Name, Role, Value (opens in new tab) — WCAG level A
Further reading
Deque University on aria-input-field-name (opens in new tab)
Deque maintains axe-core, the open-source engine our scanner runs. Their page documents the rule as the engine implements it.
Automated checks find failures a browser can prove. They cannot judge whether a caption is accurate, whether an alt text is useful, or whether a page can be operated end to end with a keyboard — those need a person.