This increases performance and reduces traffic over the Web.
Forms validation on the client-side is essential — it saves time and bandwidth, and gives you more options to point out to the user where they’ve gone wrong in filling out the form.
Ok, that was pretty good, but don’t you feel that it’s a little too much code for every field?
What if we create a simple library of functions that can save lots of typing and download time for the page?
This makes it possible to highlight only the field that has been incorrectly completed, which in turn makes revising and successfully submitting the form much easier for the visitor.
If you present users with all errors at the same time, most people will try to remember and correct them at once, instead of attempting to re-submit after each correction.