An error message appears just as someone tries to move forward and something fails. If it only says “invalid entry,” the person has to guess what to change. If it explains which field needs attention and how to fix it, a setback becomes a manageable step. That matters in contact, sign-up, application, and checkout forms: when correction is confusing, people may simply give up.
The editorial rule is simple: describe the specific problem and offer a possible action. The W3C WAI form validation tutorial recommends helping people avoid mistakes and explaining how to resolve them. WCAG also says that when an input error is detected automatically, the affected item must be identified and the error described in text; changing its color alone is not enough. See the W3C explanation of error identification.
What an error message needs to answer
The person reading it should be able to answer three questions: Where is the problem? What happened? What can I do next? Not every case needs a long explanation. But it should give enough detail that fixing the problem does not depend on interpreting codes, knowing hidden rules, or trying options at random.
- Identify the field: name it using its label, such as “Email address.”
- Explain the reason: “This format doesn’t look valid” is more useful than “Error.”
- Suggest a next step: “Enter an address such as name@example.com” gives a concrete correction.
- Keep the tone respectful: describe what happened without blaming or mocking the person.
For example, replace “Incorrect entry” with “The delivery date must be after today. Check the date and try again.” The second version connects the rule to an action. Use examples that fit the actual task; do not present a sample address as if it were the only acceptable format.
Put the message where people can find it
When a field fails validation, show the explanation near that control. This prevents people from having to remember a distant warning while searching for what to fix. If several errors occur, consider adding a linked summary at the top of the form and keeping a message beside each affected field. The summary announces that submission did not succeed; local messages help people correct each entry.
When redisplaying a form, preserve information already entered when appropriate. Losing everything because of one field can turn a small correction into repeated work. Do not retain or repeat sensitive information on screen if doing so would be unsafe. For an important action, such as confirming a purchase, allowing someone to review the information before submission can also help prevent mistakes that are hard to reverse.

Explain requirements before someone makes a mistake
Do not wait for an error to reveal a rule that could have been explained in advance. If a field requires a particular date format, state it beside the label or in visible instructions. Clearly identify required and optional fields; do not rely on an asterisk without explaining what it means.
It is also worth checking whether validation is too strict. Phone numbers, names, and addresses can be entered in different ways. W3C guidance recommends accommodating common formats; rejecting a phone number just because it contains spaces or hyphens, for example, can block valid input. Ask only for information you need, and impose strict requirements only when there is a real reason.
Accessibility: color does not explain an error
You can highlight a field with a border, icon, or color, but pair those cues with text. The message should be programmatically associated with the field so assistive technology can communicate the relationship. If a person submits a form with errors, make sure the feedback is noticeable. Depending on the design and form behavior, moving focus to the first invalid field or to an error summary may help.
The W3C WAI guide to form notifications explains the value of combining overall feedback with messages near controls, and notes that moving focus to the first error can help after submission. The implementation depends on the technology; check the result with a keyboard and screen reader, not just a visual screenshot.
A practical pre-publication review
- Trigger each expected error: leave required fields blank and try invalid formats and values at the limits.
- Read each message without looking at the field. Is it clear what went wrong and how to fix it?
- Check that the message appears near the control and that the error is also communicated in text.
- Use a keyboard to reach the affected field and continue without losing your place.
- Test on a small screen and make sure messages are visible and distinct from instructions.
- Confirm that non-sensitive entries remain after a failed submission and that the server validates submitted data.
Browser validation can make immediate correction easier, but it does not replace server-side validation: client-side checks can be bypassed or altered. Treat both as part of functional review, not just wording.
A good error message does not point a finger; it makes the next step clear.
To improve an existing form, start with a simple test: fill it out with intentional mistakes and note every moment when the next step is unclear. Rewrite those messages first using field, reason, and action; then check their placement, accessibility, and data retention. This focused review can improve the experience without redesigning the whole site.