I understand that validating on keypress is not recommended because it's annoying to get errors thrown in your face when you haven't finished filling out the field yet.

However, what about the scenario where you make a mistake, move to the next form field, return to the form field with the mistake, correct the mistake, and haven't yet changed focus away from the input field? Doesn't it make sense to remove the error message? Ie. doesn't it make sense to validate on keypress after an incorrect attempt to fill in a form field?

As a concrete example, consider:

enter image description here

After I correct the error by entering my name, doesn't it make sense to remove the error message, even though I haven't moved focus away from the form field yet?

  • If i am getting you correct, then it must be cleared once no mistake or after error gets solved, in a same way it displayed on keypress.
    – divy3993
    Commented Jun 21, 2017 at 6:18
  • @divy3993 I'm not sure that I understand your question. I edited the post to be more clear. Basically, in the gif I posted, wouldn't it make sense to remove the error after I typed "adam", even though I haven't moved focus away from the form field yet? Commented Jun 21, 2017 at 22:03

1 Answer 1


Clear the error when the user modifies the field, and re-validate it when they unselect the field.

  • See Etsy's registration form for an example.
  • If you clear the error when they focus on the field, they might not have read the message.
    • But once they modify the field, you can assume they've established how to fix it.

Additionally, use positive live inline validation to tell the user when their input is valid.

According to the Baymard Institute's benchmarks, validation is done particularly well on the checkout pages of B&H Photo and Etsy.

The Baymard Institute's Usability Testing of Inline Form Validation article is the most comprehensive guide I've come across regarding inline validation.

As an aside, Alan Cooper wrote:

Users don't want to believe that they make mistakes, which means following their mental model must absolve them of blame.

This is why positive inline validation works so well, and negative inline validation should be used sparingly to avoid frustrating your users.

  • Interesting. I hadn't thought of either of those points, and I like them! Would you mind elaborating on any user research done on those practices? Commented Jun 21, 2017 at 22:02
  • Does that count towards even 'Optional' fields? I'm thinking here of a summary or description field, whereby form submission or text input has no validation in terms of format. My understanding has been that inline validation is used mostly toward required fields that have input requirements, such as password requirements, or cases where a username is queried to see if it's unique. If you have any examples where this is used, that would be great...
    – Mike M
    Commented Jun 21, 2017 at 23:50
  • I've modified my answer to be more specific, and included some examples and research which should hopefully address your questions.
    – user101673
    Commented Jun 22, 2017 at 7:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.