3

I have a form with a few fields in them. I wish to validate all of them before I could submit the details entered. For example, First Name should have atleast 1 character. Email should match the Email-format. Password should be atleast 6 characters and so on...

Based on the validation, I have to put a green-right-tick or a red-cross symbol at the end of the field.

I'm working on an android app, but I think a similar problem could occur in a web app too.

Now, my question is when should I validate the fields? By validating, I mean either I put the right-tick or, the wrong-cross with Error Message. Here are the options that I'm considering right now:

  1. I validate them with every keystroke.

  2. I validate a particular field when focus from that field goes away. That's when the user is done typing into that field.

  3. I start validating when a user pauses typing for sometime, say 0.5 seconds.

I know the question might be opinion-based, but from the perspective of an End user, what would be the best experience? Please add more options as well, if we can have something better than the above 3 options.

1
  • You should use 3rd option as when user pause typing. Commented Mar 6, 2018 at 7:42

1 Answer 1

2

I'd advise against validating with every keystroke. People often change their minds mid-typing and being greeted with an error message when you feel like you're not done yet, can be frustrating.

An often used combo is to validate after a period of inactivity and after loss of focus.

Loss of focus works great because it occurs right after people feel like they are done with a single field, but have not yet submitted the form in its entirety. It helps users feel confident that once they submit; they are really done. Once they submit, they adjust mental modes from 'in progress' to 'complete'. It's much harder to backtrack from that mental state of 'completion', than it is to adjust values on the go.

Period of inactivity is helpful if a user becomes distracted; it redirects attention to the form. However, the timing in which the validation appears is crucial; don't make it appear too quickly. It will feel like a punishment ("Why aren't you done yet"). With some fields, people tend to take their time while the field is in focus, think: registering a username or password.

Also: If you have specific formats your field inputs need to adhere to, make sure you communicate that to your user beforehand.

1

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