# Error Identification: Clear Form Error Messages

Source: https://allyway.ai/glossary/error-identification

Error identification means that when a website detects an input error automatically, it points out the field in error and describes the problem to the user in text. It is required by WCAG 3.3.1 at Level A.

Error identification is what happens when a form rejects an entry and tells people exactly which field is wrong and why – in words, not only with a red border. If a checkout simply reloads with the same fields and no message, many users have no idea what went wrong and give up. Clear error messages turn a failed submission into a quick correction.

## What it means

[WCAG 3.3.1 Error Identification](https://www.w3.org/WAI/WCAG22/Understanding/error-identification.html) (Level A, [WCAG 2.2](https://allyway.ai/regulations/wcag-2-2)) says: "If an input error is automatically detected, the item that is in error is identified and the error is described to the user in text." Two things are required: the field in error is identified, and the nature of the problem is described in text.

An input error covers two cases: required information that was left out, and information outside the required format or allowed values. The criterion only applies when the website detects the error itself – through client-side or server-side validation. If the page silently corrects an out-of-range value, users must still be told about the change.

| Situation | Verdict |
|---|---|
| Message "Email address: please enter an address like name@example.com" next to the field | Passes – field identified, error in text |
| Error summary at the top of the form that names each field | Passes – W3C allows a list, inline text or a dialog |
| Only a red border around the field | Fails – color is not text |
| Form reloads with the old values and no message | Fails – nothing tells the user what failed |
| Icon with "!" and no text alternative | Fails – the error is not described in text |

> **Note:** > **Color may help, text is required**
> Red borders, icons and images are welcome as extra cues. People who are blind, have low vision or color vision deficiency still need the error in text. Keep the text readable too – error red often fails [color contrast](https://allyway.ai/glossary/color-contrast).

3.3.1 does not require the field to be marked in code, but W3C points to 4.1.2 for that. Telling users how to fix the entry is the job of [error suggestion](https://allyway.ai/glossary/error-suggestion) (3.3.3).

## Examples

```html title="Example"
<label for="email">Email address (required)</label>
<input id="email" type="email" aria-invalid="true" aria-describedby="email-error">
<p id="email-error">Error: The email address is missing an @ sign.</p>

<!-- Error summary, announced when it appears -->
<div role="alert">
  <h2>2 problems with your order</h2>
  <ul>
    <li><a href="#email">Email address: the @ sign is missing</a></li>
    <li><a href="#zip">Postal code: please enter 5 digits</a></li>
  </ul>
</div>
```

The message is connected to the field with `aria-describedby`, `aria-invalid="true"` (technique ARIA21) marks the field, and `role="alert"` (ARIA19) makes [screen readers](https://allyway.ai/glossary/screen-reader) announce the summary. More on announcing changes in [ARIA live regions](https://allyway.ai/glossary/aria-live).

**Do:** Do

Name the field and the problem in plain words ("Postal code: please enter 5 digits"), show the message next to the field and, for long forms, in a summary with links to each field. Keep the user's entries.

**Don't:** Don't

Rely on a red outline or an icon alone, show a generic "Invalid input" without saying where, clear the whole form after an error, or remove the message before people had time to read it.

## How to check error identification



## Questions

Q: Is a red border enough to show a form error?
A: No. WCAG 3.3.1 requires the error to be described in text. A red border can stay as an extra cue, but add a message such as "Phone number: please use digits only".

Q: Where should error messages appear?
A: W3C does not prescribe a place: inline next to the field, a list at the top of the form or an alert all work. For longer forms, combine both – a summary with links and a message at each field.

Q: Does WCAG 3.3.1 apply to required fields?
A: Yes. Leaving out required information is one of the two kinds of input error the criterion covers. Say which field is missing, and mark required fields in the label before people start typing.

Q: Do error messages have to be announced by screen readers?
A: 3.3.1 asks for the error in text. Making a new message announced without moving the focus is covered by 4.1.3 Status Messages, for example with role="alert" or a live region.
