Form labels · WCAG 1.3.1, 3.3.2, 4.1.2
Missing form label: what it means and how to fix it
The short answer
A missing form label means an input, dropdown or text area has no label tied to it in the code, so screen readers cannot say what the field is for. Fix it with a visible label element whose for attribute matches the field's id, or wrap the label around the field. A placeholder alone can pass a checker, but the HTML standard says not to use it as one.
What "missing form label" means
"Missing form label" is the name WAVE, WebAIM's checker, gives this error. Its documentation describes it as an <input> (except types of image, submit, reset, button, or hidden), <select>, or <textarea> that "does not have a properly associated label". The axe-core engine reports the same
problem under its rule label, with the title "Form elements must have labels", and reports dropdowns
under a separate rule, select-name.
Both are about the code, not the look. A field can have the word "Email" right beside it and still fail, because nothing in the markup says that word belongs to that field. A screen reader may then announce the field without saying what it is for. The W3C's Understanding 3.3.2 page adds that labels help people who use voice commands, because the label tells them what to say to reach the field. And a label tied to its field gives everyone a larger area to click, as the W3C's forms tutorial explains.
Which WCAG criteria it touches
Three WCAG 2.2 success criteria share the work, and all three are Level A. If WCAG levels are new to you, our article on WCAG contrast ratios explains how A, AA and AAA fit together.
| Criterion | Level | What it asks of a form field |
|---|---|---|
| 1.3.1 Info and Relationships | A | The link between the label and the field is in the code |
| 3.3.2 Labels or Instructions | A | Labels or instructions are provided when content requires user input |
| 4.1.2 Name, Role, Value | A | The field has a name that assistive technology can read |
The W3C explains the split on its Understanding 3.3.2 page. A field can have a visible label and pass 3.3.2, yet fail
1.3.1 if that label is not associated with it. And a field with an aria-label can pass 4.1.2 and still
fail 3.3.2, "because the labels or instructions are not presented to all users, but only to those using assistive
technologies". axe maps its label rule to 4.1.2. A related criterion, 2.5.3 Label in Name, asks that the name
contains the text that is presented visually, so the words people see are words they can say.
How to fix a missing form label
The W3C tutorial and the axe rule page both start with a visible <label> tied to the field in the code,
and both treat ARIA as the option for when a visible label does not fit the design.
- Explicit label:
<label for="email">Email</label>followed by<input type="email" id="email">. Theforattribute must exactly match the field'sid, and each id must be unique on the page. - Implicit label: wrap the field, as in
<label>Email <input type="email"></label>. This helps when a script generates the field and you do not know its id. The W3C notes that explicit labels are generally better supported by assistive technology. - Visually hidden label: keep the
<label>in the code but hide it with a visually hidden CSS class, when the purpose is clear from what is around it, such as a search field next to a Search button. aria-labelledby: point the field at the id of visible text elsewhere, for example a table heading.aria-label: a name that only assistive technology gets. The W3C tutorial says to use it only when the label of the control is clear from the surrounding content.
Buttons are the exception. A <button> takes its name from its text, a submit input from its value and an image button from its alt, so they need no label element. Hidden inputs need
none either.
16 label patterns, tested with axe-core
How we tested
We built each pattern as a small form and ran axe-core 4.14.0 in Chromium, the version Kerbwise bundles, with the WCAG 2.2 A and AA rules. Wherever a pattern had label text, that text was "Email". The table shows whether the label rule passed and the name axe computed for the field.
| Pattern | Result | Name axe computed |
|---|---|---|
| No label at all | Fail | None |
| Text beside the field, not linked | Fail | None |
| Label with for matching the id | Pass | |
| Label with for not matching the id | Fail | None |
| Label wrapped around the field | Pass | |
| Visually hidden label | Pass | |
| Label hidden with display: none | Fail | None |
| Empty label element | Fail | None |
| aria-labelledby pointing to visible text | Pass | |
| aria-label | Pass | |
| Empty aria-label, or only spaces | Fail | None |
| title attribute only | Pass | |
| placeholder attribute only | Pass | |
| Checkbox with text beside it, not linked | Fail | None |
| Text area with no label | Fail | None |
| Dropdown with no label (select-name rule) | Fail | None |
The failures are the ones you would expect, plus two that are easy to miss: a for that points at a
slightly different id, such as for="email" on a field with id="e", and a label hidden with display: none. For the second, axe said: "Form element has explicit <label> that is hidden". The
W3C tutorial warns that screen readers hide elements styled with display: none and visibility: hidden, so use a visually hidden class instead.
Why a placeholder or title only looks fixed
Two rows in the table pass for reasons that do not hold up. A placeholder gives a field an accessible name, so axe counts it. But the HTML standard says "the placeholder attribute should not be used as an alternative to a label", and the hint is only shown before the user enters a value. Once someone types, the only visible clue to what the field is for is gone. The axe rule page says the same: it is not a recommended solution.
A title attribute also gives a name. The W3C tutorial calls it "generally less reliable and not
recommended", because some screen readers and assistive technologies do not treat it as a replacement for the label
element, and sighted users see it as a tooltip when they hover over the field with a mouse. axe has a separate
best-practice rule, label-title-only, which is not tied to a WCAG criterion. When we switched it on, it
flagged the title-only field.
What automated checks can and cannot decide
A checker can tell whether a field has a name and where the name comes from. It cannot tell whether the name makes sense. "Field 1" passes the label rule, though success criterion 2.4.6 Headings and Labels (Level AA) asks that labels describe topic or purpose. A checker also measures one state of the page: a form that only appears after a click, or a field added by a script later, is only checked if it is on the page during the scan. Automated checks find many issues, but not all of them, so a manual review is still needed. Tabbing through the form with a screen reader on is a good test.
Kerbwise runs axe-core's label and select-name rules with its other WCAG 2.2 A and AA checks
on the page you have open. For each issue found by automated checks, it explains in plain language who is affected and
gives a code fix for the site's platform that adds an aria-label with text in brackets, such as aria-label="[What to enter here]" for a field or aria-label="[What this list is for]" for a dropdown, with a note that a visible label linked
to it is even better. Replace the text in brackets: in our test, a field with that bracketed text left in also passed axe,
so a rescan alone will not tell you it is still there.
Questions people ask
- What does missing form label mean?
- A form field, such as a text input, a dropdown or a text area, has no label that is tied to it in the code. The words may be on screen next to the field, but nothing in the markup says they belong to it, so assistive technology cannot announce them as the field's name.
- Does a placeholder count as a label?
- Not as a real fix. In our test with axe-core 4.14.0, a field with only a placeholder passed the label rule, because a placeholder can give a field an accessible name. The HTML standard says the placeholder attribute should not be used as an alternative to a label, and the text disappears once someone types.
- Is aria-label enough to fix a missing form label?
- It gives the field a name that screen readers announce, which addresses 4.1.2 Name, Role, Value. But nobody can see it, so the W3C suggests it only when the purpose of the field is clear from the content around it. Otherwise the field can still fail 3.3.2 Labels or Instructions.
- Do buttons and hidden inputs need a label?
- No label element is needed for them. A button takes its name from its text, a submit or reset input from its value, an image button from its alt text, and a hidden input is not shown to anyone, so it needs no label.
- Can I hide the label visually?
- Yes, when the purpose of the field is clear from the context, such as a search field next to a Search button. Hide it with a visually hidden CSS class, not with display: none, which also hides it from screen readers. In our test, axe failed a field whose label had display: none.
- Which WCAG level are form labels?
- Level A. The three success criteria involved, 1.3.1 Info and Relationships, 3.3.2 Labels or Instructions and 4.1.2 Name, Role, Value, are all Level A in WCAG 2.2.