- Level
- A
- Since
- WCAG 2.0
- Entries
- 21 / 193
3.3.1 Error Identification
When a form rejects what a person entered, the page has to say in words which field is wrong and what is wrong with it.
/ What it requires
When software detects an input error, in the browser or on the server, two things must happen: the field in error is identified, and the error is described to the user in text. A red border alone does neither for someone who cannot see colour or the screen. People using screen readers, people with colour blindness and people who find forms hard to follow all need a sentence that names the field and the problem, such as "Email: enter an address that contains the at sign".
The criterion applies only to errors that are detected automatically, and it names no exceptions. It does not require a suggestion for how to correct the entry, which is the job of 3.3.3 at level AA, although a good message often does both. Colour and icons may accompany the text and cannot replace it. A summary that says only "The form contains errors" fails, because it does not identify the item in error. A message that names no field fails for the same reason.
/ How pages fail it
- An invalid field gets a red border and no text.
- The form reloads with a banner saying only that there are errors, and no field is named.
- The error is shown as an icon that has no text alternative.
- A message appears next to the field only visually and is not tied to it in the code, so a screen reader user who returns to the field does not hear it.
- The only signal is a submit button that stays disabled, with no explanation of which field holds it back.
/ How to check it yourself
- Submit the form empty, then with deliberately wrong values such as an email address without the at sign. Use a test form where a real submission would place an order.
- For each error, check that there is text, that it names the field or sits right beside it, and that it says what is wrong.
- Look at the page in greyscale, or simply ignore colour. Every error must still be findable.
- Inspect a field in error in the developer tools and look for aria-invalid="true" and an aria-describedby that points at the id of the message.
- Repeat the submission with a free screen reader such as NVDA running. Listen for the errors when they appear and again when you tab to the field.
/ How to fix it
- Print a text message next to each field in error, give the message an id and reference it from the input with aria-describedby.
- Set aria-invalid="true" on the field while it is in error and remove it once the value is accepted.
- Name the field in the message, as in "Postcode: use the format 00-000", so that it makes sense when read on its own.
- After a failed submission, add a summary at the top that lists each error as a link to its field, and move focus to it or give it role="alert".
- Keep the red border and the icon as extra signals, never as the only ones.
/ What our scanner checks
The error-not-associated check finds visible text in an element with role="alert" or with "error" or "invalid" in its class name, and picks the first field in the same block. It reports the message unless the field references it through aria-describedby or aria-errormessage, or has aria-invalid="true" beside an alert. It submits nothing, so errors shown only after sending stay unseen.
/ Who fails it, in our own measurements
One page per body, measured by automated checks on a weekly schedule. Any body that has fixed something since the last sweep will show it at the next one, and every entity page carries a right of reply.
/ Questions about this criterion
Is a red border enough to show a form error?
No. The criterion requires the error to be described in text, and 1.4.1 Use of Color separately forbids using colour as the only way to convey information. A red border can stay as a visual aid. Next to it there has to be a message in words that says which field is affected and what is wrong.
What is the difference between 3.3.1 and 3.3.3?
3.3.1 Error Identification, level A, asks that the field in error is identified and the error described in text. 3.3.3 Error Suggestion, level AA, goes one step further: when the system knows how the entry could be corrected, it has to say so, unless that would put security or the purpose of the content at risk.
Do error messages need aria-describedby or aria-invalid?
The criterion does not name any attribute. It asks for the outcome: the item is identified and the error is described in text. In HTML, aria-invalid on the field and aria-describedby pointing at the message are the usual way to carry that outcome to a screen reader user, who may otherwise never come across the text placed beside the field.
