Skip to content
Let’s Talk
Guides

Website Form Error Messages: How to Help People Fix Mistakes

How to write and design website form error messages that are clear, accessible and helpful, so customers can correct mistakes and complete enquiries or orders.

By the Prism Works Studio team · · 7 min read

Key takeaways

  • A good error message says what went wrong, where it happened and how to fix it, in plain language.
  • Show errors next to the field, keep what people typed, and never rely on colour alone.
  • Preventing errors with clear labels, examples and flexible input is better than catching them afterwards.

Forms are where websites earn their keep. An enquiry form, a quote request, a booking or a checkout is the point where a visitor becomes a lead or a customer. It is also where things go wrong: a missed field, a phone number typed with spaces, a postcode the form does not like. How your site responds in that moment decides whether the person fixes it and carries on, or gives up.

Error messages are a small part of a website, but they carry a lot of weight. This guide explains how to write and design form errors that help people finish, with practical examples for UK small business websites and online shops.

Why form errors matter

Someone who has started filling in a form has already shown intent. Losing them at that stage is frustrating for both sides. Unhelpful errors are a common source of friction: a red box with no explanation, a message at the top of the page that does not say which field is wrong, or a form that clears everything typed after a single mistake.

Good error handling is also part of accessibility. People using screen readers, people with cognitive differences and people on small screens all depend on errors being clear and well placed. Our guide to website accessibility covers the wider picture.

What a good error message includes

Every error message should answer three questions:

  1. What went wrong? Say what the problem is, not just that there is one.
  2. Where? Make it obvious which field needs attention.
  3. How do I fix it? Tell people what to do next.

Compare these two messages for an email field:

  • "Invalid input."
  • "Enter an email address in the correct format, like name@example.co.uk."

The second tells the person exactly what is expected. It is slightly longer, but it saves a guess.

Writing error messages

Use plain, calm language

Avoid technical terms such as "validation failed" or "field required". Avoid blame, too: "You entered the wrong date" feels sharper than "Enter a date in the future". Keep the tone neutral and helpful. Humour rarely works in error messages, because the person is already slightly annoyed.

Be specific to the problem

One field can fail in different ways, and each deserves its own message. A phone field might be empty, too short or contain letters. "Enter a phone number" suits the first; "Enter a phone number using numbers only" suits the third. Generic messages for every case make people work out the problem themselves.

Start with the action

Messages that begin with a verb, such as enter, select or choose, are quick to scan. "Select a delivery date" is clearer than "A delivery date has not been selected".

Match the label

Use the same words in the error as in the field label. If the label says "Postcode", do not call it "ZIP" or "post code" in the message.

Designing how errors appear

Put errors next to the field

Show each message directly above or below the field it refers to. People's attention is on the field, and on a phone the top of the page may be off screen.

Add a summary on longer forms

For forms with several fields, a summary at the top listing each error, with links that jump to the relevant field, helps people see everything at once. Move focus to the summary after submission so screen reader users hear it.

Never rely on colour alone

A red border is not enough. Some people cannot distinguish red, and colour does not carry meaning to a screen reader. Pair colour with text and, ideally, an icon. Make sure error text has enough contrast against its background.

Keep what people typed

Clearing the whole form after one mistake is one of the fastest ways to lose someone. Keep every valid entry in place and only highlight the fields that need attention. For security reasons, password fields may be cleared, and that is acceptable if it is explained.

When to show errors

Timing matters as much as wording.

  • On submit: checking when the person presses the button is predictable and reliable.
  • On leaving a field: checking after someone moves to the next field can catch problems early, but should not fire before they have had a chance to finish typing.
  • While typing: showing errors on every keystroke is usually distracting. A half-typed email address is not wrong yet.

A balanced approach is to check on submit and, once a field has shown an error, update it as the person corrects it so they can see when it is fixed.

Preventing errors in the first place

The best error message is the one nobody needs to see. Small design choices can stop mistakes happening.

Clear labels and hints

Every field needs a visible label, not just placeholder text that vanishes when typing starts. Add short hints where the format matters, such as "For example, SW1A 1AA" under a postcode field.

Accept flexible input

Let people type phone numbers with or without spaces, postcodes in upper or lower case, and card numbers with or without gaps. Clean the data behind the scenes instead of making people match a strict format. UK phone numbers in particular are written in many ways.

Ask only for what you need

Every extra field is another chance for an error. Review your forms and remove anything you do not genuinely use. Our guide to website contact forms covers form length and field choice.

Use the right field types

Email, phone and number field types bring up suitable keyboards on phones and can enable autofill. Autofill reduces typing and with it, typing mistakes.

Mark optional or required fields clearly

Decide on one convention and stick to it. Many forms mark optional fields with "(optional)", which works well when most fields are required.

Errors in checkout

Checkout errors deserve extra care, because they sit between a customer and a sale. On hosted checkouts such as Shopify's, much of the error handling is managed by the platform, but your store settings still affect what customers are asked for. Our article on Shopify checkout settings explains which fields you can control.

Payment errors are a special case. When a card is declined, the message is often limited by what the payment provider returns. Keep the wording calm, suggest checking details or trying another method, and make sure the basket is not lost.

Errors after submission

Some problems only appear after a form has been sent, such as a server problem or a spam check that blocks a genuine message. If the submission fails, tell the person clearly, keep their entries, and give another way to get in touch, such as a phone number or email address.

Check from time to time that your forms still deliver messages. A form that appears to work but silently fails is worse than one that shows an error. Our guide to website maintenance suggests routine checks.

Testing your form errors

Try to break your own forms. Leave fields empty, enter the wrong format, use long names and unusual characters, and submit on a phone. Then try with a keyboard only, without a mouse, and if you can, with a screen reader. Ask someone unfamiliar with the site to complete the form while you watch quietly. Points where they hesitate are worth improving.

Getting help

Prism Works Studio designs and builds websites and online shops for UK businesses, including forms that are clear, accessible and easy to complete. If your enquiry or checkout forms are not performing, our website and ecommerce development team can review them.

FAQs

Should error messages appear at the top of the form or next to the field?

Next to the field, always. On longer forms, add a summary at the top as well, with links to each field that needs attention.

Is red the right colour for errors?

Red is widely understood, but it should never be the only signal. Combine it with clear text and an icon, and check contrast.

Should I check fields while people type?

Usually not. Checking on every keystroke flags problems before people have finished. Check on submit or when someone leaves a field, then update as they correct it.

What should happen if a form fails to send?

Tell the person clearly, keep everything they typed, and offer another way to contact you so the enquiry is not lost.

Are placeholder examples enough instead of labels?

No. Placeholder text disappears as soon as someone types and can be hard to read. Use a visible label, with hints or examples underneath where helpful.

Do form errors affect accessibility compliance?

Clear error identification is part of widely used accessibility guidelines. What legal duties apply to your business depends on your situation, so take advice if unsure.

Free consultation

Let’s Talk About Growing Your Business Online.

Book a free, no-obligation 30-minute discovery call with one of our senior digital strategists.