{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-form-validation-b4665c108b26","title":"Validate forms accessibly","summary":"Ensure forms are accessible by validating error messages, required fields, and submission logic in rendered HTML, with a focus on associating error messages using aria-describedby and ensuring required fields are marked programmatically.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-form-validation-b4665c108b26","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-form-validation-b4665c108b26","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-form-validation-b4665c108b26.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-form-validation-b4665c108b26\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Ensure required fields are marked with `required` or `aria-required`, and that error messages are linked to fields using `aria-describedby`. For client-side React forms, avoid flagging missing `method` or `action` if `onSubmit` handles submission.","instructions":"---\nname: form-validation\ndescription: \"Use when reviewing templates, rendered HTML, or shared components related to Validate forms accessibly. Validate the final browser-facing markup, not just the source framework abstraction. Distinguish between browser-posted forms and client-handled React forms so you do not over-report missing `method` or `action` as accessibility defects.\"\nmetadata:\n  category: html\n  priority: high\n  difficulty: intermediate\n  estimatedTime: \"25\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/html\/form-validation\n---\n\n# Validate forms accessibly\n\nInaccessible form validation leaves screen reader users unable to understand what went wrong and how to fix it, causing frustration and form abandonment.\n\n## Quick Reference\n\n- Associate error messages with fields using aria-describedby\n- Use aria-invalid to indicate validation state\n- Mark required fields programmatically with `required` or `aria-required`\n- Provide inline error messages near the field\n- Don't rely solely on color to indicate errors\n- Keep help text and error text linked to the field throughout validation\n\n## Check\n\nVerify forms have client-side validation with accessible error messages linked to form fields via aria-describedby. Do not flag React forms just because they omit `method` or `action` when `onSubmit` clearly handles submission client-side. Confirm required fields are exposed programmatically and grouped controls use fieldset and legend.\n\n## Fix\n\nImplement validation with clear error messages, aria-invalid states, and aria-describedby references to error text. For client-handled forms, improve validation semantics without forcing server-post patterns that the component is not using. Add `required` or `aria-required` where appropriate and use `<fieldset>` with `<legend>` for grouped choices.\n\n## Explain\n\nExplain how accessible form validation improves user experience and ensures all users can understand and correct errors.\n\n## Code Review\n\nReview templates, server-rendered HTML, and shared components that output markup related to Validate forms accessibly. Flag exact elements, attributes, and routes where the rendered HTML violates the rule. Check that help text and error text are both included in aria-describedby and that required state is exposed in markup, not only in visual styling.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/html\/form-validation\n","use_cases":["Reviewing templates and server-rendered HTML for accessible form validation","Auditing shared components that output form markup","Checking client-side validation in React forms that handle submission without server POST"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/form-validation\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-23","created_at":"2026-11-22T16:17:16.000000Z","updated_at":"2026-11-23T04:55:09.000000Z","seo_title":"Validate forms accessibly for accessibility","seo_description":"Ensure forms are accessible by validating error messages, required fields, and submission logic in rendered HTML, with a focus on associating error messages using aria-","seo_keywords":["accessible form validation","html form validation checklist","react form accessibility","aria-describedby form errors","client-side form validation"]}}