Build accessible web forms and error messages

8 steps · about 3 h 20 min · Intermediate

  1. Start with native form structure (guide, MDN Web Docs, 30 min)

    Build the controls and submission flow with semantic HTML.

  2. Give every control a label (guide, MDN Web Docs, 20 min)

    Create a programmatic name and a larger click target.

  3. Group related questions (guide, MDN Web Docs, 20 min)

    Use fieldset and legend for understandable groups.

  4. Validate without blocking understanding (guide, MDN Web Docs, 35 min)

    Combine browser validation with clear recovery instructions.

  5. Connect hints and errors (guide, MDN Web Docs, 20 min)

    Associate supporting text with the correct input.

  6. Announce urgent validation errors (guide, MDN Web Docs, 20 min)

    Use alert semantics only when immediate attention is required.

  7. Preserve keyboard operation (guide, MDN Web Docs, 30 min)

    Keep focus order and interaction predictable.

  8. Check the keyboard requirement (guide, MDN Web Docs, 25 min)

    Test every form action without a pointing device.