Academy › Build › Create your website
The error message says what to type, not that something failed
By the end of this lesson, you'll know how to write, for every field in your form, the error message that shows up when something's wrong, one that says exactly what to fix.
By Yodai · Published September 6, 2026 · Updated October 13, 2026
Someone fills out your booking form. They type the phone number with extra spaces, or leave out a digit, or paste the email with a comma instead of a period. They hit submit and the field turns red. Next to it, one word appears: Error.
That person doesn't know what they did wrong. They don't know if their phone number is entered wrong, if there's something further down the form they still need to fill in, or if the mistake is yours, not theirs. They stare at the screen for a few seconds, and if they have another tab open with a competitor, they open it. This really happens: in user testing from the Baymard Institute, one person couldn't figure out why their phone number wasn't being accepted and said that, at that point, they'd just go to another website. The problem was a space.
The first part of the job is choosing which fields to ask for, in what order, and why. There's one more piece before the submit button: what you tell people exactly when they make a mistake, so they fix it instead of leaving. Check first whether your website lets you change these messages; if not, give whoever built it the list of messages you want.
An error isn't an alarm, it's an instruction
The word Error warns you, but it doesn't instruct. It does its one job, saying something went wrong, and stops there. It doesn't say what to write instead, which is why it's almost never enough on its own. The W3C's accessibility guidelines break this into two steps: say in text which field has the error, and when you know how to fix it, say that too. Their own example: "The email isn't valid" covers the first step; "Enter a valid email in the format name@domain.com" covers both.
A good error message answers one question: what do I need to write differently to make this work? If someone reads it and still doesn't know what key to press next, the message isn't doing its job, no matter how red the field is.
Tone matters too. Among the form guidelines tested with 65 people in a University of Basel study is this one: the error message is polite, uses words anyone can understand, and says both what's wrong and how to fix it. If your website talks to people in a friendly, straightforward way without raising its voice, the error message should do the same: enter the phone number with 9 digits fixes it; INVALID PHONE NUMBER, in all caps, neither says what to write nor sounds friendly to someone who was one click away from booking.
In data from 1,362 forms published by Zuko, a company that sells software for measuring how people fill out forms, email and phone rank just behind password, though at noticeably lower rates, as the two fields with the highest drop-off among the six most common ones. This is the company's own data, not an independent study, but it points to these two fields as the first ones worth writing carefully. The same rule applies later to name or date fields too, if those can also go wrong in your case.
The email fails because of a typo, not the format
The phone number fails because of formatting: a digit is missing, there's an extra country code, or the form doesn't accept spaces. The email fails because of a typo: the @ is missing, the period turns into a comma, the domain gets cut off halfway through. These are two different kinds of mistakes, and the message should tell them apart. For the phone number, you can even state the exact digit count: Spain's national telephone numbering plan sets the rule that phone numbers are always dialed with all 9 digits. What you shouldn't do is require it to be typed without spaces: in the Baymard Institute test mentioned earlier, that was exactly the problem, the website wouldn't accept a number with a space in it.
If someone types janesmithgmail.com, telling them "Invalid email" doesn't show them where the problem is. "Your email is missing the @, check how you typed it" does, because it points to the exact missing character and doesn't make them reread the whole thing letter by letter. The Baymard Institute calls this an adapted message: the form already knows which rule failed, so it can say so. In their comparison of online stores, 98% use generic messages.
If the mistake is at the end, like jane@gmail without the ".com", the same kind of message works: "Looks like your email is missing the ending, like '.com'." You don't need to write a different sentence for every variation of the same mistake, but it's worth having two or three ready for the mistakes that really do keep repeating, instead of one generic line that covers everything and says nothing.
- "Invalid phone format"
- "This field is required"
- "Enter a valid email"
- "Enter your phone number with its 10 digits, for example 5551234567"
- "We need your name to confirm your appointment"
- "Your email is missing the @, check how you typed it"
Which one to pick: Always choose the second column: it says what to write, not just that something's wrong. Even a required field left blank can't be fixed with a colored border alone: W3C guidelines require the error to be stated in text, and color can be added on top, never used instead.
How to write it, field by field
For phone, email, and any other field that might fail in your form, the same four rules apply. The fourth one has a study behind it: in a University of Basel test with 303 people, messages placed right next to the failing field performed better than ones placed above or below the form, and above was exactly where most websites put them.
- 1Name the field, not the failure
Instead of "Required field," write "We need your name to confirm your appointment." People figure out what's missing faster when the message talks about the information you're asking for, not the technical rule that got broken. - 2Show the format that works
If it's a formatting error, put a correct example right in the message: "5551234567," not "invalid format." Copying an example takes less effort than guessing at a rule nobody explained. - 3Remind them why, if it's not obvious
If a field raises doubt, like the phone number, repeat in a short sentence why you're asking for it: to confirm by WhatsApp. You already explained it next to the field; repeating it in the error message isn't overkill, because that's exactly the moment someone wonders if it's worth continuing. - 4Place the message right next to the field that failed
Not just in a list at the top of the form, with all the errors lumped together. Below or beside the specific field, so the eye doesn't have to search for it or figure out which field is the problem among the rest. A list at the top can go along with it, but shouldn't replace it.
- Every field that can fail already has its message written, showing the format that works
- No message stops at the word "Error": all of them say what to write instead
- The phone number and the email have their own sentences for their most common mistakes, not one generic line
- The message lives right next to the field that failed; a list at the top of the form can go along with it, not replace it
- What's still pending is what to call the button that submits all this
Test yourself
Answer before opening each one. If one gives you trouble, go back to the section that explains it.
1. Someone leaves the phone field blank and hits submit.
"Required field" won't cut it here: the message has to name the information and the reason for it, for example "We need your phone number to confirm your appointment by WhatsApp," because that way they understand what's missing and why it's worth filling in.
2. A client with a phone from outside Spain enters their number with their country's code, and the form only accepts 9 digits with no code.
A message alone isn't enough here: the number is typed correctly, and it's the form that's rejecting it, the same thing that happened with the space in the Baymard test mentioned earlier. First, make the form accept numbers with a country code; then, add a message for that case: "If your number isn't from Spain, write it with your country's code in front, starting with +." Otherwise, that person will try several times with a number that was already correct.
3. The email is typed as maria@gmail, without ending in ".com".
The message points to the exact mistake, "Looks like your email is missing the ending, like '.com'", instead of a generic "Invalid email", because someone who made a typo will fix it in a second if they know where to look.
Every message already says what to fix, not that something failed. There's one last piece of text to write: the button's, and why a plain "Submit" lets bookings slip away that could have closed.
Sources
- Understanding Success Criterion 3.3.1: Error Identification. W3C, Web Accessibility Initiative (WCAG 2.2 guidelines), updated June 2026.
- Designing Usable Web Forms: Empirical Evaluation of Web Form Improvement Guidelines. Mirjam Seckler, Silvia Heinz, Javier A. Bargas-Avila, Klaus Opwis, and Alexandre N. Tuch, University of Basel, CHI 2014 proceedings.
- User-friendly locations of error messages in web forms: put them on the right side of the erroneous input field. Mirjam Seckler, Alexandre N. Tuch, Klaus Opwis, and Javier A. Bargas-Avila, University of Basel, Interacting with Computers, 2012.
- Improve Validation Errors with Adaptive Messages (98% Don't). Baymard Institute, 2023.
- Which form fields cause the biggest UX problems?. Zuko, accessed October 2026.
- National Telephone Numbering Plan. Spain's Ministry for Digital Transformation and the Civil Service, accessed October 2026.
Yodai builds the site from what you tell it, with a store, bookings or quote requests depending on what you do. See what the website for your business looks like.
NextThe button that doesn't just say "Submit"