Who it affects
A patient using JAWS to book a clinic appointment hears Date of birth for the field, while a friend on VoiceOver hears Format: DD MM YYYY for the same field. One of them does not know what the field is.
Someone using voice control says click date of birth and the software may not recognise the field, because its computed name is the other label.
Someone who clicks labels to focus fields clicks the hint text and jumps into a field, which is fine, until the hint and the label disagree about what the field is.
Broken versus fixed
Both examples are live and rendered in a sandboxed frame. The broken one is deliberately broken.
Two labels, one field. One screen reader announces Date of birth; another announces For example 31 3 1985; a third reads both run together.
Announced the same way everywhere: Date of birth, edit text, For example 31 3 1985. Name first, hint after.
Show the markup behind both examples
<style>body{font-family:system-ui;padding:16px;margin:0}label{display:block;font-size:14px}.hint{color:#555;font-size:13px;margin-bottom:4px}input{display:block;padding:8px;font-size:15px;border:1px solid #888;border-radius:6px;width:180px}</style>
<h2 style="font-size:17px;margin:0 0 10px">Book an appointment</h2>
<label for="dob">Date of birth</label>
<label for="dob" class="hint">For example 31 3 1985</label>
<input id="dob" type="text">
<style>body{font-family:system-ui;padding:16px;margin:0}label{display:block;font-size:14px}.hint{color:#555;font-size:13px;margin-bottom:4px}input{display:block;padding:8px;font-size:15px;border:1px solid #888;border-radius:6px;width:180px}</style>
<h2 style="font-size:17px;margin:0 0 10px">Book an appointment</h2>
<label for="dob">Date of birth</label>
<p id="dob-hint" class="hint">For example 31 3 1985</p>
<input id="dob" type="text" aria-describedby="dob-hint">
Test it by hand in two minutes
- Right click the field and choose Inspect. Note its id, then search the Elements panel for for="that-id". There should be exactly one match.
- Click each piece of text near the field. If more than one piece moves the cursor into the field, more than one label is attached.
- Turn on VoiceOver (Cmd+F5) or NVDA and Tab to the field. Write down what is announced. If you can, try a second screen reader and compare; the name should be the same.
- Check that any hint text is still read after the name, via aria-describedby, rather than lost in the merge.
The fix
<label for="dob">Date of birth</label>
<label for="dob">For example 31 3 1985</label>
<input id="dob" type="text">
<label for="dob">Date of birth</label>
<p id="dob-hint">For example 31 3 1985</p>
<input id="dob" type="text" aria-describedby="dob-hint">
The label is the name; aria-describedby adds the hint afterwards. This is the pattern most design systems use for hint text.
Merge into one label
<label for="ref">Reference</label>
<label for="ref">number</label>
<input id="ref">
<label for="ref">Reference number</label>
<input id="ref">
If both labels are really one phrase split for layout, join them and style the pieces with span elements inside the single label.
Copy and paste left-over
<label for="email">Email</label>
<input id="email" type="email">
<label for="email">Phone</label>
<input id="phone" type="tel">
<label for="email">Email</label>
<input id="email" type="email">
<label for="phone">Phone</label>
<input id="phone" type="tel">
Often the second label is a typo in the for attribute. Fix the id and both fields get the right name.
Common mistakes
- Using a second label element for hint or error text because it styles nicely.
- Copying a field and forgetting to change the for attribute on its label.
- Hiding one of the two labels with CSS; it still counts as a label to assistive technology.
- Adding aria-label on top of two labels, which gives the field a third candidate name.
WCAG criteria this rule maps to
axe-core tags this rule as WCAG 2.2 level A. It is one of the checks for:
- 3.3.2 Labels or Instructions (level A). Official W3C text.
The scanner can count how many label elements point at the same field. It cannot tell which one you meant, so it flags the field and leaves the choice to you. Automated tools find only part of the accessibility problems on a page; a pass on this rule is not a pass on the criterion.
Related rules
label
Every input and textarea needs a label that is programmatically tied to it, not just sitting nearby.
A
Select menus must have an accessible name
select-name
A select element is a drop-down list of choices.
A
ARIA input fields must have an accessible name
aria-input-field-name
When a div or span is given a form role such as textbox, combobox, listbox, slider or spinbutton, assistive technology treats it as a field.
A
ids used by ARIA and labels must be unique
duplicate-id-aria
aria-labelledby, aria-describedby, aria-controls and the label for attribute all work by id.