ARIA input fields must have an accessible name
Custom fields with roles such as `textbox`, `combobox`, `listbox`, `searchbox`, `slider` or `spinbutton` need an accessible name, so users know what information to enter or choose.
| Rule ID | aria-input-field-name |
|---|---|
| Impact | Serious |
| Success criterion | 4.1.2 Name, Role, Value · A |
| Standards | WCAG 2.0 · WCAG 2.1 · WCAG 2.2 · Section 508 · EN 301 549 |
| Fixed with a text: from the page or written by AI |
Example
<p>Departure city</p>
<div role="combobox" tabindex="0" aria-expanded="false" aria-controls="cities">
Select…
</div>A screen reader says “combobox, collapsed” and gives no hint of which city is wanted.
<p id="from-label">Departure city</p>
<div role="combobox" tabindex="0" aria-expanded="false" aria-controls="cities" aria-labelledby="from-label">
Select…
</div>A screen reader says “Departure city, combobox, collapsed”.
Why it matters
Screen reader users fill in forms field by field, usually by tabbing. Each time focus lands on a field, they hear its name and role. Without a name they hear “edit text” or “slider” and must guess from surrounding text, which they may not have read. On a booking form with departure and arrival fields side by side, a wrong guess means a wrong booking.
Custom fields do not benefit from the <label for> mechanism, which only works with native form controls. Text placed visually next to a custom field is not connected to it unless you link it with ARIA. Voice control users also need the name to move to the field by speaking, and some password managers and autofill tools use it to recognise fields.
How to fix it
Connect each custom field to a name.
Visible label text exists. Give it an id and reference it with aria-labelledby:
<span id="guests-label">Number of guests</span>
<div role="spinbutton" tabindex="0" aria-valuenow="2" aria-valuemin="1" aria-valuemax="8" aria-labelledby="guests-label">2</div>
No visible label. Use aria-label, but consider showing a label instead, since it helps everyone:
<div role="searchbox" contenteditable="true" aria-label="Search recipes"></div>
Several labels. aria-labelledby accepts a list of ids, which is useful for grids of sliders:
<div role="slider" aria-labelledby="bass-label eq-title" …></div>
Native alternative. If the widget only needs standard behaviour, use <input>, <select> or <textarea> with a <label>. Native fields come with keyboard support, autofill and naming built in:
<label for="from">Departure city</label>
<select id="from">…</select>
A <label> element pointing at a div with an ARIA role does not name it; use aria-labelledby.
Checklist
- Give every custom input field a name.
- Use aria-labelledby to connect visible label text.
- Do not rely on label for with non-native fields.
- Prefer native inputs and selects where possible.
How the check works
The check finds elements with the roles combobox, listbox, searchbox, slider, spinbutton or textbox that are not native form controls. It passes when the element has a non-empty aria-label, an aria-labelledby pointing to text, or a title. It fails otherwise, or when a <label> is used that does not name the element. Check that names are meaningful by hand.
Resources
- Understanding 4.1.2 Name, Role, Value W3C
- W3C ACT rule e086e5 W3C ACT
- Providing accessible names and descriptions ARIA Authoring Practices Guide
- Combobox pattern ARIA Authoring Practices Guide
- Slider pattern ARIA Authoring Practices Guide
- Labeling controls W3C WAI
Updated October 27, 2026