Forms
Form fields need a label
- Rule:
label - Severity: Critical
- WCAG level A
Why it matters
An unlabelled input is announced as "edit, blank". The person can hear that a field exists but not what belongs in it, and the error on submit will not explain it either.
How to fix it
- Add a <label for="..."> whose value matches the field id.
- Where the design has no room, use aria-label with the same wording the placeholder shows.
- A placeholder is not a label: it disappears on the first keystroke and often fails contrast.
In markup
<input type="email" id="email"><label for="email">Email</label>
<input type="email" id="email">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 label (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.