Free guideThe newsletter. Real UI fixes by email, and a free 35-page guide to AI design skills.
Ship Better UI

, 1 minute 29 seconds

When should a form show validation errors?

The rule

Check a field when people leave it, then check every key while an error shows so it clears on the fix, and say what is missing with an example right under the box.

Try it

Apply the fix

Prompt for your AI coding tool

Paste it into Claude Code, Cursor or any AI coding tool, then share the page you want fixed.

Review the form fields in the interface I share. Fix when and how they show validation errors, and change nothing else.

1. When to check: wait until people leave the field (on blur). No errors while they are still typing: 0 warnings mid-typing, 1 check when they move on.
2. When to clear: once an error is showing, check on every key, so it clears on the key that fixes it, not when they leave the field again.
3. What to say: replace vague messages such as "Invalid email" with what is missing plus an example, right under the field. For example: "Add the ending, like maya@acme.com". Name the error in words and suggest the fix (WCAG 3.3.1 and 3.3.3).

Keep the fields, the labels, the layout and the colours. When you are done, list each field you changed: when it checked before and after, and its old and new message.

More prompts like this in the free guide 

The problem

The sign-up form in the video checks the email box on every key Maya presses. After one letter it already says "Invalid email", and it flags her 10 times before she has finished typing. She isn't wrong. She isn't done yet. And when the message comes, "Invalid email" says nothing about what is wrong or how to fix it.

The fix

  1. Check on blur. Wait until she leaves the box. She types with 0 warnings, and the form checks once, when she moves on.
  2. Clear on the fix. Once an error is showing, check on every key. It clears on the key that fixes it (here, the 2nd key she types back in), not when she leaves the box again.
  3. Say how. Swap "Invalid email" for what is missing plus an example, right under the box: "Add the ending, like maya@acme.com".

Why it works

A half-typed address is not a mistake, so an error at that point only interrupts. Checking on blur gives the verdict when she is ready for it. Once she knows something is wrong, she is fixing it, so the form answers every key and takes the error away the moment it is right. The new message names the error in words and suggests the fix, which is what WCAG 3.3.1 and 3.3.3 ask for.

How to apply it

Go through each field in your forms and ask three questions. Does it wait until people leave the field? Does an error that is showing clear on the key that fixes it? Does the message say what is missing, with an example, right under the box? Be late to warn and quick to forgive.

Free guide · 35 pages

Get fixes like this by email

Join the newsletter and get the 35-page guide to AI design skills: the skills, the order to use them in, and prompts to copy.

Watch it on

More on interaction

All 8 lessons on interaction