Skip to the content.

Accessible forms

Every field

<div class="field">
  <label for="email">Email address</label>
  <p id="email-hint" class="hint">We'll send the receipt here.</p>
  <input id="email" name="email" type="email" autocomplete="email" required
         aria-describedby="email-hint email-error" aria-invalid="true">
  <p id="email-error" class="error">Enter an email address in the format name@example.com</p>
</div>

Validation

Authentication (WCAG 2.2, 3.3.8)

Do not require a cognitive test (remembering or transcribing) to log in: allow paste into password and code fields, support password managers (autocomplete="current-password"), and offer alternatives to puzzles.

Custom controls

Prefer native <select>, <input type="checkbox">, <input type="radio">, styled with CSS (appearance, accent-color). If you must build a custom combobox, listbox or switch, follow the ARIA Authoring Practices pattern exactly (roles, aria-expanded, aria-activedescendant or roving tabindex, arrow keys, Escape) and test with a keyboard and a screen reader.

Checklist before shipping