
August 8th, 2004, 10:38 PM
|
 |
Contributing User
|
|
Join Date: May 2004
Location: Battle Creek, Michigan
Posts: 352
Time spent in forums: 30 sec
Reputation Power: 5
|
|
Javascript Form Validation Alerts Are EVIL!!!
As programmers sometimes we forget who are actually using forms so we code the easiest method to inform the end user that there are errors in the form because this makes our life easier. That method is the infamous multiple alert!
But for the end user, those poor people who have to endure these alerts, error alerts get annoying rather quickly possibly resulting in disabling javascript or worse yet, leaving the site to never return again. Ever.
For short forms, such as 2 or 3 fields, thisn't isn't that big of a problem. But with a form like the following example, it's a BIG problem. Example: http://developer.netscape.com/docs/...val/USform.html
Alternative methods of informing the user that the form has validation errors in it are:
- Display ALL errors with 1 alert.
- Pros: Simple, fast, & easy to code.
- Cons: Can get annoying after many attempts to fix errors.
- Display Image errors.
- Pros: Short code.

- Cons: Requires images for each error type.
- Display errors next to form fields.
- Pros: User-friendly.

- Cons: Too much code.

- Or use Server-Side validation only.
- Pros: Get's the job done right.
- Cons: Round trips to server.
If there is another method that is not listed here, please feel free to post it and a working example. Now that I'm done rambling on and on, cast your vote in my poll and voice your opinion...
|