Saturday, February 13, 2016

usability - Text Field Validation vs Prevention


I've been having a debate (mostly with myself) over the best approach to deal with invalid input in text fields -- validation versus prevention.


Taking a numeric text field as an example, is it better to prevent the entry of non-numeric characters (allowing for special cases like sign, decimal pt., etc.) or allow the entry of whatever and then indicate an error message (typically when focus is left) if the result is invalid?


The first approach is "don't allow the user to do something you know is wrong" but has the disadvantage that it may not be at all obvious what is going on if a keyboard key is typed and nothing happens. It also breaks the expectation that, if you type something in a text field, you expect to see what you typed.


In the past, I've generally leaned towards the prevention approach but in general but feel perhaps, at the field input-level, the validation approach provides a better user experience. Is anyone aware of a best practice here?



Answer



Prevention will likely frustrate a user as they are entering it and it isn't working. Of course this can be fixed with adequate messaging that lets them know why certain characters were rejected.


Some users may also be typing with their heads down and may not see when some characters are rejected. If they are typing 10 characters but only a few within those keystrokes are rejected, they may never know since their head is down.


In general I have preferred validation as it allowed the user to see their error. As you get more complex inputs it may become more difficult for users to understand why some characters are rejected.


No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...