HTML & Semantics6 min readUpdated 2026-11-15

Accessible Forms & Labels: Error Handling, Hints & Autocomplete

Eliminate form friction with explicit <label> associations, non-disappearing instructions, and accessible inline validation.

Key Takeaways

  • Never replace <label> with placeholder text.
  • Connect field hints and errors using aria-describedby and aria-invalid='true'.
  • Add HTML autocomplete attributes for personal info fields (WCAG 1.3.5).

Wiring Labels, Hints & Errors

When validation fails, show specific corrective text beside the field, mark aria-invalid='true', and announce summary feedback politely or move focus to an error summary.

Complete Accessible Input

Recommended Pattern
<label for="email">Work email</label>
<input id="email" type="email" autocomplete="email" aria-describedby="email-err" aria-invalid="true">
<p id="email-err" role="alert">Enter a valid email like name@company.com.</p>

Frequently Asked Questions

Validating on submit (or gently on blur after leaving a field) avoids interrupting screen-reader users mid-typing.

Interactive Tools for This Guide

ARIA & Dev

Accessible Form Generator

Generate semantic forms with labels, hint wiring, error alerts, and autocomplete.

Open tool

Continue Reading