Skip to content

Understand · beginner level

Form fields

Why a text next to a field is not enough, and how to tie a label to it so the screen reader announces it.

Updated on

When a person enters a form field with a screen reader, the software announces the field’s name, then its type, for instance “Name, edit”. If the field has no name, they only hear “edit” and do not know what to type. That name comes from the field’s label.

RGAA criterion 11.1 (French original): Chaque champ de formulaire a-t-il une étiquette ? WCAG 2.2: 1.3.1 Info and Relationships, 3.3.2 Labels or Instructions and 4.1.2 Name, Role, Value (Level A), and 2.4.6 Headings and Labels (Level AA).

The label and the accessible name

For the RGAA glossary, the label is the text next to the field that tells you the nature, type or format of the information expected. For the screen reader to announce it, it must be tied to the field. When several techniques are present, the browser calculates the accessible name in a strict order:

  1. the text referenced by the aria-labelledby attribute;
  2. otherwise, the aria-label attribute;
  3. otherwise, the label element tied to the field;
  4. otherwise, the title attribute.

The placeholder, the grey sample text shown in an empty field, is not on this list. The NVDA announcements quoted below were recorded with NVDA 2026.1.1 in French and Chrome, on the French version of these examples; they are given in French with their translation.

In the non-compliant examples and in the search example, the fields are drawn: they do not receive focus and do not count among the fields on this page. The other two are real fields you can try.

Example: a label element tied with for and id

Join the library

Code

<label for="name">Last name</label> <input id="name" type="text" autocomplete="family-name">

Compliant. The label’s for attribute and the field’s id attribute share the same value: the browser ties the two. The screen reader announces “Last name” in the field, and clicking the words “Last name” places the cursor in the field. Try it in the frame above.

Example: a label placed next to the field, but not tied to it

Join the library

Phone

Code

<label>Phone</label> <input type="tel" autocomplete="tel">

Non-compliant. On screen, nothing sets this example apart from the previous one. But the label has no for attribute and does not contain the field: nothing ties “Phone” to the field. NVDA announced « édition, vide » (“edit, blank”), with no name.

Example: a placeholder instead of a label

Get the newsletter

Your email address

Code

<input type="email" placeholder="Your email address">

Non-compliant. NVDA still announced the placeholder followed by « édition » (“edit”): with no label, Chrome uses the placeholder as a fallback name. But the text disappears as soon as the person starts typing, and they can no longer check what was asked. The placeholder meets none of the criterion’s conditions.

Example: a text tied with aria-labelledby

Book a study room

Preferred date

Code

<span id="date">Preferred date</span> <input type="text" aria-labelledby="date">

Compliant. aria-labelledby points to the text “Preferred date” by its id: the screen reader announces that text as the field’s name. With this technique, clicking the text does not place the cursor in the field; a label remains more convenient whenever possible.

Example: a search field and its button

Search

Code

<form role="search" action="/search">
  <input type="search" title="Search the site"> <button>Search</button>
</form>

Compliant. The RGAA allows this case: the adjacent button provides the visible label, and the title attribute gives the field its accessible name. On the French version, NVDA announced « Rechercher dans le site, édition » (“Search the site, edit”).

Key points

  • A text placed next to a field is not enough: it must be tied to the field.
  • The simplest solution: <label for="x"> and id="x" on the field.
  • A placeholder can be added to the label; on its own, it does not count.
  • What NVDA announces is not enough to conclude: check the technique in the code.

To practise: the quiz “Links and form fields”, which also covers links.