Accessible Forms WCAG: Labels, Errors, and 2.2 Auth

Accessible Forms WCAG: Labels, Errors, and 2.2 Auth

Missing form input labels are among the most common WCAG failures that automated testing finds on homepages. Programmatic labels, error summaries, autocomplete, and the WCAG 2.2 additions on Redundant Entry and Accessible Authentication.

Missing form input labels are among the most common WCAG failures that automated testing finds on homepages (WebAIM Million 2024) — and a broken form blocks the transaction or registration entirely. The load-bearing criteria are SC 1.3.1 (programmatic labels), SC 3.3.1 (error identification), SC 3.3.2 (labels or instructions, including required-field indication), and SC 1.3.5 (autocomplete). WCAG 2.2 added three form-related criteria targeting cognitive disability — Redundant Entry (SC 3.3.7) and Accessible Authentication (SC 3.3.8 / 3.3.9) — and the authentication criterion applies to every login flow. This guide covers labels, fieldsets, error patterns, the 2.2 additions, and multi-step focus management.

Why forms are a frequent source of accessibility failures

Forms are among the highest-stakes accessibility surfaces on a website. A broken hero image is an annoyance; a broken sign-up form blocks a transaction, registration, or support request entirely. The user does not get the service.

The WebAIM Million 2024 report found missing form input labels on 48.6% of the top million homepages, the third most common WCAG failure after low-contrast text and missing image alternative text (as of Feb 2024 data, WebAIM). The share has stayed largely unchanged across six annual reports (2019-2024), despite forms being a well-understood pattern.

Forms also touch every WCAG principle simultaneously — Perceivable (the label must be visible and high-contrast), Operable (every control must be keyboard-reachable), Understandable (errors must be clear and recoverable), and Robust (the programmatic name must be exposed correctly to assistive tech). A form that fails any one of these fails the user.

WCAG 2.2 added three form-related success criteria, all targeting cognitive disability accommodation. They are not edge cases — Accessible Authentication in particular applies to the login flow of any service that has one.

Programmatic labels — the foundation

Every form control needs a label. The canonical pattern is <label for> wrapping the visible label text, with the for attribute matching the input's id:

html
<label for="email">Email address</label>
<input type="email" id="email" name="email" autocomplete="email" />

Wrapping <label> around the input also works — implicit association, where the input is a child of the label — but W3C's forms tutorial notes that explicit for/id labels are generally better supported by assistive technology, so use the implicit form when an explicit association is not possible.

aria-label is a fallback only when no visible label is possible — W3C's forms tutorial limits it to controls whose purpose is clear from the surrounding content, such as a search field next to a Search button:

html
<input type="search" aria-label="Search the site" />

But even here, a visually hidden label associated with <label for> is often preferred over aria-label, because it remains real text in the page. Reach for aria-label when the existing markup makes a <label> impossible, not as a default.

Placeholder text is not a label. The placeholder disappears the moment the user starts typing, is often styled in low-contrast gray, and serves only as a last-resort accessible name when no label exists, so the label effectively vanishes for sighted users once typing starts. The placeholder-as-label pattern is a common form accessibility regression.

html
<label for="email">Email address</label>
<input type="email" id="email" name="email" autocomplete="email"
       aria-describedby="email-hint" />
<p id="email-hint" class="hint">We'll only use this for order confirmation.</p>

The aria-describedby reference attaches helper text to the input — the screen reader announces the label first, then the hint, when the input receives focus.

Grouping related fields with fieldset and legend

Radio button groups and checkbox groups need an outer <fieldset> with a <legend> that names the group. Depending on their configuration, some screen readers read out the legend with every field, once, or, rarely, not at all — W3C's forms tutorial advises keeping the legend short for that reason. When it is read, it gives group context that a single label cannot:

html
<fieldset>
  <legend>Shipping speed</legend>
  <label><input type="radio" name="shipping" value="standard" /> Standard (5-7 days)</label>
  <label><input type="radio" name="shipping" value="express" /> Express (2-3 days)</label>
  <label><input type="radio" name="shipping" value="overnight" /> Overnight</label>
</fieldset>

SC 1.3.1 Info and Relationships requires that information, structure, and relationships conveyed through presentation can be programmatically determined or are available in text. For a group like this, <fieldset>/<legend> is the native way to meet it (technique H71); grouping roles (technique ARIA17) are another sufficient technique. Without a programmatic group label, a screen reader user hearing "Standard" has no context for what the option pertains to.

The same applies to billing addresses, multi-checkbox preferences, and date pickers split across multiple inputs. Visual styling can hide the fieldset border with CSS (border: 0; padding: 0; margin: 0) without breaking the accessibility tree, but the legend should remain in the document flow.

The alternative role="group" plus aria-labelledby is a W3C-documented grouping pattern that functions similarly to <fieldset> and <legend>. Prefer the native elements where the layout allows.

Error identification, suggestion, and prevention

Three WCAG criteria at Level A and AA govern error handling (a fourth, SC 3.3.6 Error Prevention (All), is Level AAA).

SC 3.3.1 Error Identification at Level A requires that, if an input error is automatically detected, the item in error is identified and the error is described to the user in text. A red border around an invalid input fails 3.3.1 if no text describes the error. Associating the text with the failing input via aria-describedby goes beyond the criterion's minimum and makes the error announced on focus:

html
<label for="email">Email address</label>
<input type="email" id="email" name="email"
       aria-invalid="true" aria-describedby="email-error" />
<p id="email-error" class="error">Enter a valid email address, like name@example.com.</p>

aria-invalid="true" on the failing input plus aria-describedby pointing to the error message means the screen reader announces the error when focus enters the field. On valid fields, omit aria-invalid or set it to false.

SC 3.3.3 Error Suggestion at Level AA requires that, if an input error is automatically detected and suggestions for correction are known, the suggestions are provided to the user, unless it would jeopardize the security or purpose of the content. "Email address invalid" alone does not satisfy 3.3.3 — "Enter a valid email address, like name@example.com" does. The suggestion does not need to be a magic auto-fix, just an actionable hint.

SC 3.3.4 Error Prevention (Legal, Financial, Data) at Level AA applies to web pages that cause legal commitments or financial transactions for the user, that modify or delete user-controllable data in data storage systems, or that submit user test responses. At least one of the following must be true: the submission is reversible; the data entered is checked for input errors and the user can correct them; or the user can review, confirm, and correct the information before finalizing the submission. A multi-step checkout with a review step where the user can confirm and correct the order satisfies 3.3.4; a one-click "buy now" with no review step needs one of the other options instead — the order can be reversed, or the entered data is checked for input errors and the user can correct them.

For long forms with multiple errors, the error summary pattern is a widely used approach. On submit failure, focus moves to a summary at the top of the form that lists each error as a link to the failing field:

html
<div tabindex="-1" id="error-summary">
  <div role="alert">
    <h2>There's a problem with your submission</h2>
    <ul>
      <li><a href="#email">Enter a valid email address</a></li>
      <li><a href="#password">Password must be at least 12 characters</a></li>
    </ul>
  </div>
</div>

The GOV.UK Design System error summary is one documented implementation: it moves keyboard focus to the summary on submit failure, and each error links to the corresponding field. Without a summary or another announced notification, screen reader users in long forms may not learn that submission failed or where the errors are.

Required fields and autocomplete

SC 3.3.2 Labels or Instructions at Level A requires labels or instructions when content requires user input; indicating which fields are required is one of its sufficient techniques, and W3C lists exposing the required state programmatically (with aria-required) as an advisory technique for SC 1.3.1, 3.3.1, and 3.3.2.

The HTML5 required attribute on the input is the right starting point — it exposes the required state to assistive technology and triggers built-in validation. Visual indication needs both an asterisk and a key explaining what the asterisk means, or the literal word "required" in the label:

html
<label for="email">
  Email address <span aria-hidden="true" class="required-mark">*</span>
  <span class="sr-only">required</span>
</label>
<input type="email" id="email" name="email" required autocomplete="email" />

Color alone — a red label without an asterisk or text — fails SC 1.4.1 Use of Color because users with low vision or color blindness may not perceive the cue. The asterisk plus visually hidden "required" text is a common pattern.

SC 1.3.5 Identify Input Purpose, new in WCAG 2.1 at Level AA, requires that the purpose of each input field collecting information about the user can be programmatically determined when the field serves one of the purposes listed in WCAG's Input Purposes section (such as name, email, street address, and payment card number) and the technology supports identifying that meaning — in HTML, the autocomplete attribute is the sufficient technique. The standard tokens are defined in the WHATWG HTML Standard autofill section:

html
<label for="given-name">First name</label>
<input type="text" id="given-name" name="given-name" autocomplete="given-name" />

<label for="email">Email</label>
<input type="email" id="email" name="email" autocomplete="email" />

<label for="cc-number">Card number</label>
<input type="text" id="cc-number" name="cc-number" autocomplete="cc-number"
       inputmode="numeric" />

Autocomplete tokens help more than assistive-technology users — browsers fill the form faster, password managers integrate cleanly, and users with motor impairments avoid retyping the same information across sites.

WCAG 2.2 additions — Redundant Entry and Accessible Authentication

WCAG 2.2 added three success criteria that target cognitive disability accommodation in forms.

SC 3.3.7 Redundant Entry at Level A requires that information previously entered by or provided to the user that is required to be entered again in the same process is either auto-populated or available for the user to select. The classic example is a checkout that asks for the same address twice (shipping and billing); a "same as shipping" checkbox satisfies the criterion. In a multi-step form, information needed again in a later step has to be auto-populated or offered for selection; a wizard that asks "what's your email?" on step 1 and makes the user type it again on step 4 fails. The exceptions are when re-entering the information is essential (for example, a memory game), when it is required to ensure the security of the content, or when the previously entered information is no longer valid.

SC 3.3.8 Accessible Authentication (Minimum) at Level AA, also new in 2.2, covers every step of an authentication process, such as login. A cognitive function test is not required for any step unless that step provides at least one of the following: an alternative authentication method that does not rely on a cognitive function test; a mechanism that assists the user in completing the test (WCAG's examples are password-manager support and copy and paste); a test that is to recognize objects; or a test that is to identify non-text content the user provided to the website. A cognitive function test includes memorizing a password, transcribing a code from an email, or solving a puzzle — in WCAG's definition, any task that requires the user to remember, manipulate, or transcribe information, although the common identifiers name, email address, and phone number are not considered cognitive function tests.

Compliance paths: passkeys satisfy 3.3.8 because the device proves identity without the user transcribing anything. Magic links satisfy it because the user clicks rather than transcribes. Biometric authentication (fingerprint, face) satisfies it. Supporting password managers satisfies it: if the login form lets the browser or a password manager fill the fields, that mechanism reduces the need to remember or retype the password. Critically, blocking paste or autofill on password or code fields forces transcription, so a site that does so fails unless it offers another authentication path ("paste is a security risk" is not an exception).

Text-transcription CAPTCHAs do not satisfy 3.3.8 on their own; object-recognition CAPTCHAs (pick the images with cars) are excepted at Level AA but not at AAA. Sites that require a transcription CAPTCHA before login must offer an authentication method that does not rely on a cognitive function test, such as a passkey (WebAuthn) or an email link.

SC 3.3.9 Accessible Authentication (Enhanced) at Level AAA removes 3.3.8's exceptions for tests that recognize objects and tests that identify non-text content the user provided to the website, so an authentication step that uses a cognitive function test still has to provide at least one of the two remaining options: an alternative authentication method that does not rely on a cognitive function test, or a mechanism that assists the user in completing the test. W3C does not recommend requiring Level AAA conformance as a general policy for entire sites, but design system tokens that aim for AAA on authentication flows are good practice.

Multi-step forms and focus management

Multi-step forms — onboarding, checkout, complex applications — add a focus management surface that single-page forms do not have.

On step transition, move focus to the new step's primary heading or first field. Without explicit focus movement, screen reader users may get no clear signal that the step changed, even though the visible UI has changed entirely. The destination heading needs tabindex="-1" to be programmatically focusable:

html
<h2 tabindex="-1" id="step-2-heading">Step 2 of 4: Shipping address</h2>

Pair the focus move with an aria-live="polite" region that announces step progress. When the current step is shown visually, it must also be programmatically determinable or available in text (SC 1.3.1) — aria-current="step" on the active step in the visible step list is the current convention:

html
<ol class="steps">
  <li><a href="#step-1">1. Account</a></li>
  <li aria-current="step"><a href="#step-2">2. Shipping</a></li>
  <li>3. Payment</li>
  <li>4. Review</li>
</ol>

Save state across steps. Redundant Entry (SC 3.3.7) requires that information the user must provide again later in the same process is auto-populated or available to select, unless re-entry is essential, required for security, or the earlier information is no longer valid — and Understanding 3.3.7 notes that requiring people to recall information they entered earlier can cause them to give up or re-enter it incorrectly.

Avoid time limits on individual steps unless essential. SC 2.2.1 Timing Adjustable at Level A requires that, for each time limit set by the content, at least one of these is true: the user can turn the limit off, or adjust it over a range at least ten times the default, before encountering it; the user is warned before time expires, given at least 20 seconds to extend it with a simple action, and allowed to extend it at least ten times; or the limit is a required part of a real-time event with no possible alternative, is essential (extending it would invalidate the activity), or is longer than 20 hours. A session timeout that drops the user back to step 1 with no warning fails unless the user could turn off or adjust the limit beforehand or one of those exceptions applies.

Remediation priorities for your forms

If your critical forms sit in a handful of flows — sign-up, login, checkout, contact — an audit pays back across many users once each flow is fixed.

  • Audit every form input for <label for> association. Automated tools (axe, Lighthouse) flag missing label associations
  • Verify error messages are announced — submit each form with an empty required field while running NVDA or VoiceOver
  • Confirm required state is communicated programmatically — required attribute or aria-required="true"
  • Add autocomplete tokens to every identification field — name, email, postal address, payment fields
  • Audit every authentication form against SC 3.3.8. If the only path requires memorization or transcription, add passkey or magic link as an alternative
  • Confirm error summary pattern on long forms — submit with multiple errors and verify focus moves to the summary
  • On multi-step forms, confirm step transitions move focus and announce progress; verify Redundant Entry compliance by checking that earlier-step data needed again is auto-populated or available to select, unless an exception applies

The W3C WAI Forms Tutorial is W3C's tutorial on the underlying patterns, and WCAG 2.2 is the normative source for the success criteria — the error and authentication criteria sit under its Input Assistance guideline.

Passkey or magic link plus a Redundant Entry pass over multi-step flows covers most of what the new criteria require.

Project Inquiry