Saturday, October 17, 2015

Form validation - When should error messages be triggered?


I'm working on a registration form with real-time inline validation. I'm wondering when we should trigger error messages:



  • before, when the field is in focus and until the user has entered a valid answer


  • while, when the user is typing and until the has entered a valid answer

  • after, when the field is out of focus


Field validation



Answer



One relevant study that springs to mind is described by Luke Wroblewski in Inline Validation in Web Forms. It found that validating inputs prematurely can be harmful and that validating fields after input helps users to complete forms more quickly and accurately.



To better understand when to show inline validation messages, we tested a few variations in the top half of our form.



In this version of the form, we displayed a validation message (success or error), after the user indicated that she was done answering a question by moving on to the next one. (This is validating “on blur” in technical speak.)




In this variation, we displayed (and updated) a validation message while the user answered each question. (That is, “on key press.”)



In this version, we displayed a validation message before the user answered each question—that is, as soon as they focused each form element—and then while they answered the question. (This is validating “on blur and on keypress.”)



It concluded that:



When we used the “after” method in the first half of the form, participants completed the form seven to ten seconds faster than when we used the “while” and “before and while” methods respectively. The “before and while” method not only caused longer completion times, but also produced higher error rates and worse satisfaction ratings than the other inline validation variations we tested.







  • For open-ended questions, give feedback after the user finishes providing an answer (on blur, when they move on to the next field).




  • For questions that the user might need help with sooner (e.g. username and password fields), give feedback while they are typing but use an appropriate delay so that premature error messages don’t frustrate them.




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...