forms
GUIDELINES 1.3.5, 3.3
Overview
Forms refers to the inputs, and how authors can help users to avoid and correct mistakes on said forms. Ensuring users can read and see content on the form and how to complete it.
Who is impacted
How to test
Resources
Form Labels
Every form input should have a visible, descriptive label that is programmatically associated with the input using the for/id attribute pairing or by wrapping the input within the label element. Placeholder text is not a substitute for labels, as it disappears when users start typing and is often displayed with insufficient contrast.
Labels should clearly describe what information is expected. For example, use "Email address" rather than just "Email" and indicate required fields with both visual indicators and programmatic attributes (aria-required or required).
Error Handling
When form validation errors occur, identify the specific field with the error and provide a clear text description of the problem. Error messages should suggest how to fix the issue. For example, instead of "Invalid input," say "Please enter a valid email address (e.g., name@example.com)." Errors should be announced to screen readers using aria-live regions or by moving focus to the error summary.