Skip to main content

16. Errors

Requirement

If a form displays any input errors, those errors are clearly identified, and focus is directed back to the invalid field.

Evaluation Process

To test form error handling, trigger an error state by submitting a form with empty required fields and verify the following principles:

  • Error Indication: Errors must not be conveyed by color alone. For example, a red border is insufficient. Use accompanying icons or text to ensure the indicator is perceivable to all users.
  • Explicit Messaging: Messages must clearly state that an error has occurred and provide guidance for correction (e.g., "Error: First Name is required"). The user should be provided sufficient information in order to correct the error. This does not apply to security-sensitive fields where such detail could create a vulnerability.
  • Inline Placement: Errors should be indicated inline, directly associated with the specific field in error, rather than relying solely on a generic summary message at the top of the form. Alternatively, if inline placement is not available and the error message is provided at the top of the page, then the error message includes a list of in-page links that take the user directly to the incorrect field. 

Scoring Guide

  • Pass: All form fields indicate clearly that there is an error with the input with something other than color. Instructions are provided to help the user to correct the error, if necessary.
  • Partial Fail: Some form fields do not have a clearly defined error messages or instructions on how to correct the error.
  • Fail: Form fields use only color to indicate errors or do not indicate which fields are in error.
  • Not Applicable: No form fields are on the site, or it was not possible to put the form into an error state (for example, forms are disabled until all form fields are filled in).
  • Unknown: No form fields were found during testing, but it is possible there might be some outside the scope of the testing. 

More Information

Error messages can be challenging to program correctly. Please review these methods and techniques for achieving accessible error messages:

Relevant WCAG Information

Last modified