How to fix: custom input fields without a name
WCAG 2.2 success criterion 4.1.2 (level A)
Why it matters
Combo boxes, search boxes and sliders built with ARIA have no label for screen readers.
How to fix
Add aria-label or point aria-labelledby to a visible label.
<div role="combobox" aria-labelledby="country-label">…</div>
Test it yourself
- Find custom fields with role="combobox", "searchbox", "textbox" or "spinbutton" (often search and date pickers) and check that a screen reader reads a name when you tab in.
Common mistakes
- A custom search widget with a placeholder but no label or aria-label.
- aria-labelledby pointing to an id that is missing on some pages.
Check your own site
Find this and other problems on your website in 30 seconds, free.