Cluster 16 · Forms & ARIA · aria-describedby + Errors

React Accessible Forms & ARIA Validation Guide (SC 1.3.1, 3.3.1, 3.3.2 & 4.1.3)

Build WCAG 2.2 AA React forms with useId(), explicit <label> pairing, aria-invalid, aria-describedby error summaries, and live validation announcements.

100% Browser-Side · Zero User-Data Upload · Strict CSP

1. Paste Page or Component HTML to Audit

12 WCAG 2.2 AA Checks
Informational Notice: Deterministic DOM/HTML accessibility & EAA Directive 2019/882 engineering linter — pair automated checks with live keyboard Tab & screen-reader testing. Not legal advice.
WCAG 2.2 AA & EAA Static Readiness Score
76 / 100 (B)
WARN

9/12 checks passing · Moderate Risk — Remediate Warnings Before EAA/VPAT Audit

WCAG-3.1.1 (SC 3.1.1 (Level A)): Valid document language declared (lang="en") PASS
Primary page language is explicitly declared for screen readers and braille translators.
WCAG-2.4.2 (SC 2.4.2 (Level A)): Descriptive <title> present ("Checkout — Acme Store") PASS
Document title announces page context immediately in browser tabs and screen readers.
WCAG-1.4.4 (SC 1.4.4 (Level AA)): Viewport zoom unrestricted (200%+ text scaling supported) PASS
No user-scalable=no or maximum-scale=1 lock detected.
WCAG-1.1.1 (SC 1.1.1 (Level A)): No <img> elements missing alt attributes PASS
Images include explicit alternative text attributes.
WCAG-4.1.2 (SC 4.1.2 (Level A)): All <button> and <a> elements expose accessible names PASS
No unlabelled icon-only controls detected.
WCAG-1.3.1-FORM (SC 1.3.1 / 3.3.2 (Level A)): 1 form input(s) rely on placeholder or lack <label> -12 PTS
Placeholders disappear on focus. Bind every <input>, <select>, and <textarea> to a visible <label for="..."> or aria-label.
WCAG-2.4.1 (SC 2.4.1 (Level A)): Missing skip-to-content link -8 PTS
Add <a href="#main-content" class="skip-link">Skip to main content</a> before navigation and wrap primary content in <main id="main-content">.
WCAG-1.3.1-HEADING (SC 1.3.1 / 2.4.6 (Level AA)): Sequential heading hierarchy verified (h1) PASS
Screen-reader heading navigation outline is well-ordered.
WCAG-2.1.1 (SC 2.1.1 (Level A)): Zero non-semantic clickable <div>/<span> handlers detected PASS
Interactive actions use keyboard-reachable elements.
WCAG-2.4.4 (SC 2.4.4 (Level A)): 1 generic link label(s) ("Click here" / "Read more") -4 PTS
Replace vague link text with descriptive destination wording (e.g., "Read API rate-limit documentation") or add aria-label.
WCAG-1.2.2 (SC 1.2.2 (Level A)): No uncaptioned <video> elements detected PASS
Media captioning baseline clean.
WCAG-2.4.11 (SC 2.4.3 / 2.4.11 (Level AA)): Focus order & visible focus outline checks clean PASS
No positive tabindex overrides or bare outline: none suppression found.
Accessible HTML5 Shell (wcag-2-2-aa-patch.html)
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>Checkout — Acme Store</title>
  <link rel="stylesheet" href="/wcag-2-2-focus-targets.css" />
</head>
<body>
  <a href="#main-content" class="skip-link">Skip to main content</a>
  <header>
    <nav aria-label="Primary navigation">
      <a href="/"><img src="/logo.svg" alt="Brand home" /></a>
      <button type="button" aria-label="Open navigation menu"><svg aria-hidden="true"></svg></button>
    </nav>
  </header>
  <main id="main-content">
    <h1>Primary Page Heading</h1>
    <section aria-labelledby="section-form">
      <h2 id="section-form">Accessible Form Control</h2>
      <form action="/signup" method="post">
        <label for="work-email">Work email</label>
        <input id="work-email" name="email" type="email" autocomplete="email" required />
        <button type="submit">Continue to Workspace</button>
      </form>
    </section>
  </main>
</body>
</html>
AccessCheck · WCAG 2.2 AA $39 AA Fix Pack

Verify Live WCAG 2.2 AA, Contrast, Landmarks & EU EAA Readiness

Run a full live URL accessibility & EAA readiness audit on AccessCheck (access.runglab.dev), or grab the turnkey $39 AccessCheck AA Fix Pack on Creem (tailored DOM/ARIA patches, focus & target-size CSS, EAA Annex V Accessibility Statement, VPAT 2.5 summary & CI Playwright/axe gate). Need a PayPal invoice? Email [email protected].

WCAG 2.2 AA & EU EAA Technical Control Specification

Control / Criterion Compliant Baseline Engineering & Accessibility Rationale
Label Association useId() + <label htmlFor={id}> Guarantees unique programmatic label binding across reusable React form components
Error Linking aria-invalid={Boolean(err)} + aria-describedby Screen readers announce field error immediately when input receives focus (SC 3.3.1)
Error Summary role="alert" or aria-live="polite" Announces form-level submit errors without forcing page reload (SC 4.1.3)
Autocomplete autoComplete="email" / "name" / "cc-number" Required for WCAG 1.3.5 Identify Input Purpose on personal data fields

Accessible React FormField Component (useId + aria-describedby)

AccessibleField.tsx
import { useId } from "react";

export function AccessibleField({ label, error, type = "text", autoComplete, value, onChange }) {
  const inputId = useId();
  const errorId = `${inputId}-error`;
  return (
    <div className="field">
      <label htmlFor={inputId}>{label}</label>
      <input
        id={inputId}
        type={type}
        autoComplete={autoComplete}
        value={value}
        onChange={onChange}
        aria-invalid={error ? "true" : undefined}
        aria-describedby={error ? errorId : undefined}
      />
      {error && <p id={errorId} role="alert" className="field-error">{error}</p>}
    </div>
  );
}

Accessible Radio / Checkbox Group (<fieldset> + <legend>)

AccessibleFieldset.html
<fieldset>
  <legend>Billing Cycle</legend>
  <label><input type="radio" name="cycle" value="monthly" /> Monthly ($39)</label>
  <label><input type="radio" name="cycle" value="annual" /> Annual ($390)</label>
</fieldset>

Implementation Steps & Key Insights

  1. Replace placeholder-only inputs with visible <label htmlFor={id}> elements generated via React useId().
  2. Connect inline error text to each control using aria-describedby and aria-invalid="true".
  3. Group related radio buttons and checkboxes inside semantic <fieldset> and <legend> tags.
  4. Add standard HTML autocomplete tokens (name, email, organization, postal-code) for WCAG 1.3.5.
  • Color-only red borders fail WCAG 1.4.1 Use of Color; always pair visual error borders with explicit text and icons.
  • WCAG 2.2 SC 3.3.7 Redundant Entry forbids forcing users to re-type already entered shipping or email data within the same session.

Common WCAG & EAA Audit Pitfalls

  • Using placeholder text instead of visible <label> tags.
  • Rendering validation messages in detached <span> elements without aria-describedby or role="alert".
  • Disabling submit buttons silently with disabled={true} without explaining missing fields.
Verify Live: Audit your live domain on access.runglab.dev or grab the $39 AccessCheck AA Fix Pack. Informational engineering guidance only — not legal advice.

More WCAG 2.2 AA, EU EAA & VPAT Implementation Guides

← Back to WCAG 2.2 AA & EU EAA Hub · AccessCheck Live Audit → · $39 AA Fix Pack → · Cluster 15: GDPR & Consent Mode v2 → · Cluster 12: EU AI Act Art. 50 →

Frequently Asked Questions

Can I use aria-label instead of a visible <label> on a React input?

While aria-label satisfies programmatic naming (SC 4.1.2), visible labels are strongly required by SC 3.3.2 Labels or Instructions for sighted keyboard and cognitive accessibility users.

Why does WCAG 1.3.5 require autocomplete attributes?

Standard autocomplete tokens enable browsers, password managers, and cognitive-assist extensions to autofill user fields accurately.

Should validation errors use role="alert"?

Use role="alert" on dynamically appearing error summaries after submit, and pair individual input errors with aria-describedby so users hear the specific error when focusing the field.