Skip to content

UX guides / Accessibility / Labels are programmatically associated with their fields

Labels are programmatically associated with their fields

Usually criticalHow serious this usually is when it goes wrong. Not a score.

The guideline

Associate every input's visible label with its control using a native <label for>/id pair, or aria-labelledby when a native label element is not possible. When a field enters an error state, associate the error text with the field via aria-describedby and set aria-invalid="true", so the relationship is available to assistive technology and not only implied by screen position. Group related controls — a set of radio buttons, an address block — with fieldset/legend so the group itself has a name.

Common failures

  • Form fields rely on placeholder text instead of persistent <label> elements, lack for/id associations, or use empty/visual-only labels.

Where it applies

Where

  • Applies to any site

Disciplines

  • Accessibility

Devices

  • Desktop web
  • Mobile app
  • Mobile web

Why it matters, how to fix it, and the research behind it

Rubric's full guide adds the reasoning, the fix and the sources for this check, and checks your client's pages against it and hundreds of others. Findings come back worst first.