Rule
ARIA field names
ARIA fields and value widgets must have an accessible name.
- Rule
aria-field-name- WCAG 2.2
- 4.1.2 Name, Role, Value (opens in a new tab) (Level A)
- Severity
- Serious
What it checks
The rule looks at form fields and value widgets built with ARIA roles rather than native elements: textbox, searchbox, combobox, listbox, spinbutton, slider, progressbar and meter, and the toggles checkbox, radio and switch. It fails one with no accessible name, because a screen reader then announces the role and value with nothing to say what the field is for.
For the field and value roles, text inside the element is not a name: only aria-labelledby, aria-label, title or an associated <label> counts. The toggles can take their name from their text. A combobox wrapper that takes no focus passes when the input inside it is labelled. Native <input>, <select> and <textarea> are left to form labels.
Example
Fails
<p>Delivery instructions</p>
<div role="textbox" contenteditable="true" aria-multiline="true"></div>
Passes
<p id="note-label">Delivery instructions</p>
<div role="textbox" contenteditable="true" aria-multiline="true" aria-labelledby="note-label"></div>
The engine is tested against both examples.
How to fix it
Point aria-labelledby at the visible label, or add an aria-label when there is none.
Check your own pages
This rule runs in every pour audit: the browser extension, the bookmarklet, the command line and the editor. Get pour, free.