views:

160

answers:

3

In my company, I've seen several approaches for notifying a user when their input is invalid (our validation is generally done when the user clicks some form of a "Submit" button).

Here are the most common approaches I've seen:

  • Using the ErrorProvider class to communicate which controls contain invalid input. (this is my current preference because the validation can be done in one shot and the user can easily identify which controls contain the invalid input.)

  • Validating the input in all of the controls and compiling a list of messages to display to the user. Once the validation routine has completed, display all "invalid input" messages to the user at once (via a MessageBox).

  • Validating the input in each control sequentially and notifying the user once a piece of invalid data is found (via a MessageBox). (*I'm not a fan of this approach because if Control_A and Control_B both contain invalid data, the user will have to attempt to submit the data twice in order to see both validation messages.*)

What do you think is the best way to go about effectively/efficiently notifying users of invalid input?

+1  A: 

We check all the controls when the user press OK.

We mark each invalid value with a special colour and list all the errors in a message box.

tekBlues
+1  A: 

If the technology allows and if it does not hurt logic flow or usability is any way, it is always best to notify user about errors as soon as possible. (Error provider, Ajax, anything)

It is always frustrating when the user has to submit a form several times just to find out if a user name is taken!

I have done a usability study on this: Most users leave the page in disgust unless they really want whatever is at the other end of the registration.

Bobby Alexander
+2  A: 

Using IDataError, you can combine the two first approaches, since it both allows you to provide an error for individual controls, but also an aggregate error message for the entire view.

In some cases, you may have validation logic that depends on the combination of several different input values, so only binding validation to each control would be too prohibitive. On the other hand, you still want to be able to provide an error message for each control in the many cases where this makes sense. IDataError allows you to do both. The most common UI implementation is to have a visual cue (such as a blinking icon) next to each invalid control.

Popping up a modal dialog (Message Box) each time the user does something invalid is a very effective way of annoying the user - they lose context and have to spend time clicking on the 'OK' button to make the dialog go away.

Mark Seemann