Build or fix an accessible form
Builds or repairs a web form with programmatic labels, grouping, autocomplete, helpful error messages and announced validation. Use for sign-up, checkout, settings or any data-entry form.
Forms are where accessibility failures cost the most: a person who cannot complete sign-up or checkout leaves. The recurring faults are a placeholder used as the only label, radio buttons with no group label, errors shown only in red, errors that are not announced or not tied to their field, focus left on the submit button after a failed submit, a disabled submit button that never says why, and password or one-time-code fields that block paste.
Build or repair this form (framework: ; if empty, use plain HTML and minimal JavaScript):
- If you were given code, list its barriers first, each with its WCAG criterion. If you were given a spec, skip to building.
- Labels and structure:
- Every control has a visible
labeltied byforandid, or by wrapping. A placeholder is never the label. - Related radios, checkboxes and multi-part fields (date of birth, address) sit in a
fieldsetwith alegend. - The label text matches the accessible name (2.5.3).
- Input purpose (1.3.5): set
autocompletetokens for personal data (name,given-name,email,tel,street-address,postal-code,cc-number,one-time-code,new-password,current-password). Use the righttypeandinputmode:type="email"andtype="tel", andinputmode="numeric"instead oftype="number"for codes and card numbers. - Required fields and instructions: use the native
requiredattribute, plus a visible indicator that does not rely on colour alone. Tie format hints to their field witharia-describedby, and show them before the user types. - Errors (3.3.1, 3.3.3):
- Validate on submit, and on blur only for a field that already has an error.
- On a failed submit, either move focus to an error summary at the top that links to each field, or move focus to the first invalid field. Pick one and use it consistently.
- Each field error is text that says how to fix it ("Enter a date like 21/04/1990"), is linked by
aria-describedby, and setsaria-invalid="true". Clear it as soon as the input becomes valid. - Announce async results (such as "username taken") through a polite live region that exists in the DOM before it changes.
- Do not disable the submit button to signal invalid input. Do not block paste in password or code fields (3.3.8). Do not ask again for information already given in the same process (3.3.7). Keep targets at least 24 by 24 CSS pixels (2.5.8).
- Keep the existing visual design and validation rules. Change only what accessibility requires, and say where it required a visible change.
- Native HTML first. Add ARIA only where HTML cannot express it.
- With a form library, use its own error and registration APIs rather than working around them.
- Do not invent validation rules the form or spec did not have. List any you think are missing in one line each.
- Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
- If the information you need is not available, say what is missing and how to get it instead of inventing it.
Issues
| # | Problem | WCAG SC | Field or line | Fix | Write "Built from spec" instead when no code was given.
Code
The complete fixed or new form.
Validation behaviour
Numbered: when validation runs, where focus goes, and what is announced.
Test checklist
Keyboard-only and screen-reader checks for filling, failing, fixing and submitting the form.
1 required value still a placeholder; the assistant will ask for it.
details
- kind
- Prompt: a task you run by name to get one finished thing back
- domain
- Software engineering
- category
- Accessibility
- level
- Intermediate
- made for
- Frontend engineer, Full-stack engineer
- needs
- repo-read, file-write
- risk
- edits-files
- version
- v1.0.0 · incubating
- reviewed
- 2026-10-02
- works in
- Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md
use in
npx @hermes-hq/hodios install fix-form-accessibility --target claude-codenpx skills add hermes-hq/hodios-dist --skill fix-form-accessibility -a claude-codeclaude plugin marketplace add hermes-hq/hodios-distclaude plugin install hodios-software-engineering@hodiosThe plugin brings every entry in this domain at once.
pairs well with
All of AccessibilityAccessibility specialist
Accessibility specialist who builds and reviews with WCAG, the ARIA Authoring Practices and real assistive-technology behaviour in mind, ranking barriers by who is blocked.
accessibility-specialistAudit web accessibility against WCAG 2.2
Audits markup or components against WCAG 2.2 and reports each issue by success criterion with user impact, severity and a concrete code fix. Use before a release or a compliance review.
audit-web-accessibilityAudit a mobile screen for accessibility
Audits an iOS, Android, React Native or Flutter screen for labels, traits, focus order, text scaling, touch targets, contrast and gestures, with platform fixes and a VoiceOver or TalkBack test script.
audit-mobile-accessibilityBuild an accessible ARIA widget
Implements a combobox, tabs, dialog, menu, disclosure, tree or listbox per the ARIA Authoring Practices pattern, using native elements whenever they suffice. Use for custom interactive widgets.
build-aria-widgetFix keyboard navigation in a component
Finds and fixes keyboard barriers in a UI component (focus order, traps, invisible focus, mouse-only controls) and adds a keyboard test checklist. Use when a widget fails without a mouse.
fix-keyboard-navigationReview colour contrast and fix the palette
Checks colour pairs or design tokens against contrast requirements and proposes the nearest passing alternatives that keep the brand hue. Use when defining or auditing a palette or theme.
review-color-contrast