Form error messages that help people finish: mistakes to avoid
Short answer: Good form errors tell people exactly what's wrong and how to fix it, right next to the field, at a sensible moment, and without wiping what they typed. State the rules before people type, show errors after they leave a field or submit (not while they're still typing), summarise errors at the top for long forms, and make sure screen readers announce them. Most frustrating forms fail on one or two of these, and each is a small fix.
An enquiry form, a booking form or a checkout is where interest turns into business. It's also where people give up when the form scolds them with "Invalid input" after they've typed everything. Here are the mistakes that turn a nearly-complete form into an abandoned one, and what to do instead.
Mistake 1: Hiding the rules until someone breaks them
The classic: you choose a password, submit, and only then learn it needs eight characters and a number.
Instead: show the rules up front, next to the field. Google's web.dev forms course gives exactly this example (a username or password rule revealed only after submitting) and recommends defining validation rules and communicating them. It shows how to connect the field to a short description using aria-describedby, so screen reader users hear the rule too: "Enter at least eight characters."
Mistake 2: Vague messages
"Invalid input", "Error", "Please check this field". Users have to guess.
Instead: say what's wrong and how to fix it, in plain language:
- "Enter your email address in the format name@example.com."
- "Enter a phone number with area code, like 416 555 0123."
- "Choose a delivery date at least two days from today."
Avoid technical terms ("string", "format mismatch") and blame ("You entered an invalid…").
Mistake 3: Relying on the browser's default messages
Built-in browser validation is useful, but web.dev notes that different browsers use different wording, and the text depends on the user's browser language. Your bilingual site may show an English page with a French browser message, or the reverse.
Instead: keep native validation attributes (required, type="email", minlength) for their benefits, and replace the default messages with your own consistent wording using the browser's Constraint Validation API, which web.dev covers.
Mistake 4: Shouting errors before people have finished
A field turns red the moment someone clicks into it, or after the first character typed.
Instead: validate when the user leaves the field (on blur) or on submit. Web.dev describes real-time validation by listening for the field's blur event. For styling, it explains that the CSS :invalid state applies before any interaction, which can confuse users, while :user-invalid only applies after the user has interacted. Use the latter for red borders and icons.
Mistake 5: Clearing what people typed
The form reloads with an error and every field is empty, or worse, all fields except the one that was wrong.
Instead: keep every value the user entered, including the invalid one, so they can correct it rather than retype. Only clear fields where retaining data would be a security issue, such as passwords, and say so.
Mistake 6: Errors only at the top, or only beside fields
A message at the top saying "There were 3 errors" without saying where, or errors beside fields far below the visible part of a long form.
Instead: for short forms, show errors next to each field. For long forms, do both: a summary at the top listing each error as a link to its field, and the message beside the field itself. Move focus to the summary after a failed submit so keyboard and screen reader users know what happened.
Mistake 7: Errors only in colour
A red border with no text fails people who can't distinguish red, and doesn't explain anything to anyone.
Instead: always include text, and optionally an icon. Colour reinforces; it doesn't carry the message alone.
Mistake 8: Errors screen readers can't find
The error appears visually, but assistive technology never announces it.
Instead:
- Mark the field as invalid with
aria-invalid="true"when it fails. MDN describes this attribute as indicating that the entered value isn't in a format or value the application will accept. - Link the error text to the field with
aria-describedby, so it's read when the field gets focus. - Move focus to the error summary (or the first invalid field) after submission.
Mistake 9: Overly strict rules
Rejecting phone numbers with spaces, postcodes in lower case, or names with apostrophes and hyphens creates errors for valid input.
Instead: accept common formats and clean them up yourself: strip spaces, normalise case, allow apostrophes, accents and hyphens in names. Validate what matters, not formatting preferences.
Mistake 10: Validating only in the browser
Client-side checks help users but can be bypassed.
Instead: validate again on the server, as web.dev's course notes, and show server-side errors with the same wording and placement as client-side ones.
Mistake 11: Never looking at where people fail
Without data, you're guessing which field causes trouble.
Instead: log validation failures by field (without storing what people typed) and review them monthly. A field that fails often usually has an unclear label or an unnecessary rule.
A quick test
Fill in your main form with deliberate mistakes: leave a required field empty, type a malformed email, use a name with an apostrophe, and submit. Then do it again with only a keyboard, and once with a screen reader. Every error should be clear, located, announced and fixable without retyping.
FAQ
Should errors appear as people type?
Generally no. Show them when the user leaves the field or submits. Exceptions are helpful live hints, like a password strength indicator.
How long should an error message be?
One short sentence that says what's needed. Add an example if the format isn't obvious.
Do we need an error summary on short forms?
Not always. For two or three fields, messages beside each field are enough.
Can we just disable the submit button until the form is valid?
It's often confusing, because users don't know what's missing. Let them submit and show clear errors instead.
If people keep abandoning your enquiry or booking form, send us the link and we'll test its error handling and suggest fixes.