Error Identification
When input is rejected, say so in text, and say which field. A red outline is not an error message — it is invisible to a screen reader and to anyone who cannot distinguish the colour.
- Principle
- Understandable
- Guideline
- 3.3
- Level
- A
- In WCAG since
- 2.0
- Number
- 3.3.1
Broken, then fixed
The same interface twice: first with the mistake, then with the smallest change that fixes it.
A colour and a generic banner.
Which field? A screen reader user hears "Invalid input" and nothing else. Someone who cannot see the red border has to guess, field by field.
The error names the field, in text, and links to it.
A summary at the top linking to each field, plus the message beside the field itself, tied to the input with aria-describedby. Colour still helps; it is no longer doing the work alone.
What changed in the code
The fix as a diff: removed lines are marked with a minus, added lines with a plus.
removed: <input id="email" class="is-invalid">
added: <input id="email" aria-invalid="true" aria-describedby="email-err">
added: <p id="email-err">Enter an address that includes a domain</p>
aria-invalid states that something is wrong; aria-describedby says what. Neither is sufficient on its own.
Watch it happen
This demo plays the failure out over time. It is silent and captioned, and you can pause or scrub at any point.
Screen readersilent
How to test
Check your own interface against 3.3.1, one step at a time.
- Find every form on the page and submit each one with every field left empty.
- Check that each required field you left empty is named in a text message, and that the message says what is missing.
- Fill each field with a value in the wrong format, such as letters in a phone number or a past date where a future one is needed, and submit again.
- Check that each error is described in text and names its field. A red border or an icon on its own does not count.
- Turn on a screen reader (NVDA on Windows, VoiceOver on a Mac), submit the form with errors again and check that you can reach and hear each message.
Common questions
Is a red border enough to show an error?
No. Colour and icons can add to the message, but the error has to be described in text that says which field is wrong.
Does a required field left empty count as an error under 3.3.1?
Yes. Leaving out information the form needs is an input error, so the message has to name the field and say that it is required.
Does the error message have to sit next to the field?
No. A message by the field, a summary at the top of the form or an alert all pass, as long as it names the field and describes the problem in text.
Try it yourself
A lab is a small working piece of interface that you change yourself. Read its steps, use the controls under it, and watch the verdict line at the bottom: it says whether the criterion passes or fails as you go. Reset puts it back.
Try it: show the error
How to use this lab
- Goal. Make a rejected email address clear to someone using a screen reader.
- The controls. The options under “How the error is shown” set how the mock form marks its error: A red border only, or Text tied to the field. The Submit the form button sends the form, which rejects the address ada@example. The log shows what a screen reader says.
- Try this. The lab starts on A red border only. Press Submit the form and read the log. Then choose Text tied to the field and compare.
- What it means. With Text tied to the field, 3.3.1 passes: the error is said in words with the field. With A red border only, 3.3.1 fails, because people who can’t see the border, or can’t tell red apart, never learn what went wrong. The verdict line under the lab says which.
Screen reader says
3.3.1 fails
Also in guideline 3.3
Criteria in the same guideline often fail together.
- 3.3.2, UnderstandableLevel A
Labels or Instructions
Fails when: Placeholders standing in for labels.
- 3.3.3, UnderstandableLevel AA
Error Suggestion
Fails when: The error names the field and stops there.
- 3.3.4, UnderstandableLevel AA
Error Prevention (Legal, Financial, Data)
Fails when: One irreversible click.
- 3.3.7, UnderstandableNew in 2.2Level A
Redundant Entry
Fails when: The address is typed twice.
- 3.3.8, UnderstandableNew in 2.2Level AA
Accessible Authentication (Minimum)
Fails when: A puzzle, and paste disabled.