Skip to content
Tutorials Center
My learning

Topics

Lesson 37 of 38 ยท Projects and Practice

Project: Build an Accessible Sign-up Flow

Build a complete accessible sign-up flow: labeled fields, hints, error summary, status messages, show-password toggle and a confirmation dialog, tested step by step.

In this project you combine labels, hints, error handling, live regions, focus management and a dialog into one realistic sign-up flow. You build it in stages so you can test after each one.

The finished page has:

  • A form with name, email, password (with a show/hide toggle) and a terms checkbox.
  • Inline errors plus a focus-moved error summary.
  • A native confirmation dialog on success.
  • A status message that announces progress.
  • Full keyboard support and visible focus.

Requirements (acceptance criteria)

  1. Every field has a visible label, hint if needed, and autocomplete.
  2. Required fields are marked in text.
  3. On submit with problems, focus moves to a summary with links to each field; each field shows its own message.
  4. The password can be shown or hidden with a button that has a clear name and state.
  5. Pasting into the password field is allowed.
  6. On success, a modal dialog confirms and returns focus to the form when closed.
  7. Works at 400% zoom, with keyboard only, and with reduced motion.

Stage 1: structure and labels

Start with the HTML only. Check that every field is reachable and named before adding any script.

HTML
<form id="signup" novalidate>
  <h1>Create your account</h1>
  <p>Fields marked (required) must be filled in.</p>

  <p><label for="name">Full name (required)</label>
  <input id="name" name="name" autocomplete="name" required></p>

  <p><label for="email">Email (required)</label>
  <input id="email" name="email" type="email" autocomplete="email" required></p>

  <p><label for="pw">Password (required)</label>
  <span id="pw-hint">At least 12 characters. Spaces are allowed.</span>
  <input id="pw" name="pw" type="password" autocomplete="new-password" aria-describedby="pw-hint" required>
  <button type="button" id="toggle" aria-pressed="false">Show password</button></p>

  <p><label><input type="checkbox" id="terms" required> I accept the terms (required)</label></p>

  <button type="submit">Create account</button>
</form>

Stage 2: the complete flow

Here is the finished flow. Try submitting empty, then with a short password, then successfully. Use only the keyboard.

Accessible sign-up flow

Stage 3: test it

Work through the list, and note any item that fails:

  1. Keyboard: Tab order follows the visual order; every control, including the toggle and checkbox, is reachable; Enter submits.
  2. Errors: Submit empty. Does focus land on the summary? Do the summary links jump to the right fields? Does each field announce its message?
  3. Screen reader: Listen to the password field. It should say the label, "edit protected" and the hint. After toggling, "Hide password, toggle button, pressed" is a good announcement.
  4. Dialog: After success, focus is in the dialog; Escape closes it; focus returns to the page.
  5. Zoom: 400% shows one column and no clipped text.
  6. Contrast: run your checker on the error red #b3261e (about 6.5:1 on white) and the border #767676 (about 4.5:1).
  7. Automated: run axe (see automated testing) on the page and in the error state.

Things to improve

  • When the dialog closes, move focus to a meaningful place (like a "Continue" link) instead of leaving it to the browser.
  • Add strength guidance as a polite status message, not a color bar alone.
  • Support passkeys or email sign-in as alternatives to passwords (accessible authentication).
  • Save the entries on error so users do not retype them (redundant entry).
  • Translate the messages and set lang correctly.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why should the show-password button have aria-pressed?

    aria-pressed marks a toggle button's state; alternatively, change the label text, but avoid doing both in a confusing way.
  2. 2. Which autocomplete value fits a new password field?

    new-password tells password managers to suggest a strong password rather than fill an existing one.
  3. 3. Why not block pasting into the password field?

    Blocking paste prevents password managers, which many people with memory or motor difficulties rely on (3.3.8).
  4. 4. What should happen to focus after a failed submit?

    Moving focus to the summary tells users something went wrong and where.

Summary

  • Build forms in stages: structure and labels first, then validation, then dynamic parts.
  • Combine hints, aria-describedby, aria-invalid, a focus-moved summary and a polite status message.
  • Use a native dialog for confirmation and a toggle button with a state for password visibility.
  • Test with keyboard, screen reader, zoom, contrast and axe before calling it done.

Next: Web Accessibility Audit Checklist