Article Details

Haseeb

Haseeb

CEO

Visitors open your contact form but few send it. Check your validation and error messages first, using clear guidance from web.dev and W3C WAI.

Published
November 21, 2026
Reading time
4 min read
Category
Websites

Topics

#contact form#validation#error messages#accessibility#forms#small business

Share Article

A contact form on a navy background with a valid email field with a green tick and an empty field with a red warning reading "Please fill out this field", under the title "Contact forms that people finish: validation and error messages".
Websites

Contact forms that people finish: validation and error messages

Many owners notice the same thing: people open the contact form, but few send it. There is no single cause, and this article does not promise that any change will lift your enquiries. It does give you a list of things worth checking, all based on published guidance from web.dev's forms course and from W3C WAI (the Web Accessibility Initiative).

The focus is validation: the checks a form runs on what visitors type, and the messages it shows when something is wrong. Poor wording here can turn a willing visitor into someone who gives up.

Say what is wrong in plain words

By default, browsers show their own built-in messages when a field fails a check. web.dev explains that you can replace them so every visitor sees the same custom message. Its course uses the setCustomValidity() method of the Constraint Validation API, with a simple example: "Please enter your name."

Your developer can do this. As an owner, you can test it yourself. Leave a field empty, or type something invalid, and read what appears. Does it tell an ordinary person what to do?

W3C WAI gives the standard to aim for: error messages should be easy to understand and should provide simple instructions on how they can be resolved.

Point to the field and remind people of the format

W3C WAI also says to provide an indication of how to correct mistakes, and to remind users of any format requirements. It adds that each error should refer to the label of its field.

Compare two messages:

  • "Invalid input."
  • "Phone number: please use digits only, for example 0123 456 7890."

The second names the field, says what is wrong and shows the format. (The example number is only an illustration.) Check each of your fields in this way.

Give feedback when people leave a field

web.dev notes that feedback can appear as soon as a user leaves a field. This is done by listening to the blur event in JavaScript. The benefit is that visitors learn about a problem straight away, not after they press Send and face a list of errors.

Ask your developer whether your form does this, and whether the messages are kind in tone.

Avoid errors on a form nobody has touched

A form that shows red errors before anyone has typed anything feels hostile. web.dev points to the :user-invalid CSS pseudo-class for this. In its words, the styles are only applied after user interaction. So error styling appears only after the visitor has actually used the field.

If your form shows warnings the moment the page loads, this is worth raising.

Make sure labels are properly connected

web.dev's guidance on form labels says a correctly associated label makes its text a click target and lets screen readers announce the field's name. It illustrates this with a checkbox. In practice, a properly connected label helps people tap or click the right field and helps people using screen readers know what to type.

Note that the web.dev forms validation page does not cover labels, which is why this point comes from its separate guidance on labels and text alternatives.

Do not rely on JavaScript alone

web.dev explains that browsers have built-in validation that works through the right elements and attributes. JavaScript and CSS only enhance it. So a well-built form should still work if the extra scripting fails.

The same page also says you must validate data before storing or sharing it on your backend server. Checks in the browser help visitors, but the server must repeat them. This is a job for your developer, and it protects your business as well as your visitors.

A quick self-test

Try your own contact form on a phone and on a computer:

  1. 1
    Press Send with every field empty. Is the message clear?
  2. 2
    Enter a deliberately wrong email address. Does the message say what to fix?
  3. 3
    Click out of a field. Do you get feedback straight away, without a wall of red on a fresh page?
  4. 4
    Click each label. Does the matching field activate?
  5. 5
    Read every message aloud. Would a customer understand it?

What to do next

Write down what you find and pass the list to whoever manages your site. Change one thing at a time so you can see whether it helps. Results vary, and clear error messages are one of several possible reasons for unfinished forms. The guidance above, though, comes from reputable sources and costs little to check.