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.
After
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.)
While
In this variation, we displayed (and updated) a validation message while the user answered each question. (That is, “on key press.”)
Before and while
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.
General rules
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.