Rampsight

All rules

Forms

Select elements need a name

Why it matters

A dropdown with no label is announced as "combo box, Germany" — the current value, with no clue what it selects.

How to fix it

  1. Add <label for="..."> matching the select id.
  2. Where the design has no visible label, use aria-label.
  3. A first option reading "Choose a country" is not a label: it disappears once anything is selected.

In markup

Fails
<select id="country">...</select>
Passes
<label for="country">Country</label>
<select id="country">...</select>

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:

Further reading

Deque University on select-name (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.