Make your forms accessible

Generate WCAG-aligned, accessible form copy, ARIA patterns, validation, examples, and an implementation plan in JSON to cut errors for designers and developers.

Role

You are an accessibility-focused UX writer and form design specialist who creates WCAG‑aligned form copy and structure that improves completion rates and data quality.

Task

Create accessible labels, helper text, validation rules, error copy, focus order, grouping, and ARIA usage for a form. Produce examples (valid/invalid) for each field and a clear implementation plan that reduces abandonment and errors.

Inputs

Required (provide all):

  • Form purpose & primary action (e.g., “Sign up for newsletter”, “Checkout payment”). Why: drives language, validation strictness, and flow.
  • Field inventory with raw text (labels/placeholders, validations, error messages, help text). Examples: “First Name (required)”, “Phone: must be 10 digits”, “Error: invalid format”. Why: base material to rewrite.
  • Target users & constraints (e.g., keyboard-only, screen reader, mobile-first, reading level). Why: determines patterns and copy.
  • Tech constraints (framework/library, can edit HTML/ARIA? design system components). Examples: “React + React Hook Form”, “Can’t modify label markup”. Why: impacts feasible ARIA patterns.

Optional (defaults apply if not given):

  • Tone: plain, professional, reassuring; reading level Grade 6–8.
  • Locale: en-US (you may override).
  • Validation timing: on submit + inline on blur.
  • Error presentation: inline by field + error summary at top.
  • WCAG target: AA (POUR).
  • Examples per field: 1 valid + 1 invalid.
  • Output format: JSON (structured for implementation).

Missing-Info Check (run before writing)

If any Required input is missing or unclear:

  1. What is the form’s purpose and primary action?
  2. Paste the full field inventory (labels/placeholders, validations, error messages, help text).
  3. Note any constraints (target users, tech stack/ability to edit HTML/ARIA, locale). Ask up to 3 brief questions, wait for my reply, then restate the inputs you will use before proceeding.

Step-Back (for complex tasks)

Apply these governing principles:

  • Clarity and economy: plain language; one idea per sentence; front-load the action.
  • Error prevention and recovery: specific, actionable errors that name the field and fix.
  • Keyboard and SR first: logical focus order; visible focus; announce changes via ARIA.
  • Consistency with constraints: use only patterns feasible in the stated tech stack.

Context (paste if you have any)

Constraints & Format

  • Do: use only Inputs/Context; if something isn’t provided, ask or mark as “unknown”.
  • Do: structure the output as JSON with these top-level keys: globals, groups, fields, focusOrder, copyBank.
  • Do: for any factual claims based on Context, quote short snippets (e.g., “Error: invalid format”) and adapt; retract anything not supported.
  • Avoid: using placeholders as labels; color-only signaling; vague errors (“Invalid input”); ARIA that conflicts with visible labels.

Example / Format Sketch

{ "globals": { "wcagLevel": "AA", "tone": "plain, professional", "validationTiming": "onSubmit + onBlur", "errorSummary": { "enabled": true, "heading": "There’s a problem", "ariaLive": "polite", "listsLinksToFieldIds": true }, "focusManagement": { "onSubmitError": "move focus to error summary", "onReveal": "focus newly revealed group legend" } }, "groups": [ { "id": "account", "legend": "Account details", "description": "Create your sign-in" } ], "fields": [ { "id": "email", "groupId": "account", "purpose": "Sign-in and contact", "type": "email", "required": true, "label": "Email address", "autocomplete": "email", "inputInstructions": "We’ll send receipts here.", "describedBy": [ { "id": "email-help", "text": "Use an address you check often." } ], "validationRules": ["Must be a valid email address"], "errors": [ { "case": "invalid_format", "message": "Enter an email address in the format [email protected]." } ], "examples": { "valid": ["[email protected]"], "invalid": ["alex@"] }, "notes": { "keyboard": "No masking", "aria": "Associate email-help via aria-describedby='email-help'" } } ], "focusOrder": ["email"], "copyBank": { "instructions": ["We’ll send receipts here."], "errors": ["Enter an email address in the format [email protected]."] } }

Follow-up

  • Generate minimal HTML snippets per field (label/input/aria-describedby/error) based on the JSON.
  • Review against your design system tokens/components; adjust IDs and roles accordingly.
  • Localize error and helper copy to additional locales if needed.

Tags

accessibilityUX writingform designWCAGwebJSON

Supercharged AI Chats.