Home arrow JavaScript arrow Universal Form Validation
JAVASCRIPT

Universal Form Validation


We have witnessed the wonders of JavaScript and its ability to ensure that our forms are properly filled before submission. But it gets so laborious to type and modify and update form validation scripts for every for in every application. Take heart! Upon reading and applying the methods in this article, you will never again have to worry about client-side validation! Hazzah!

Author Info:
By: Justin Cook
Rating: 4 stars4 stars4 stars4 stars4 stars / 24
February 02, 2004
TABLE OF CONTENTS:
  1. · Universal Form Validation
  2. · First, the Forms
  3. · Good Form, Jack!
  4. · Pick a Number, Any Number!
  5. · And Knowing is Half the Battle

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Universal Form Validation
(Page 1 of 5 )

The benefits of form validation cannot be over emphasized. To end-users, they can often be an annoyance. To developers, webmasters and DBAs, they are pure preventative medicine (ok, so they taste as bas as Dr. Buckley’s, but they work!). Without them our databases would be full of empty and incorrect fields, and our applications constantly spewing out gross errors due to someone’s lack of form-filling motivation.

To respond to our pleas, many websites have posted many articles, examples, and ‘cut & paste’ scripts that we can slap onto a form to have it scrutinize a user’s every move. Thanks to JavaScript, forms can become somewhat more reliable within our applications.

A tutorial for form validation can be found here. And this would suit a site well if all you have is one or two forms. But managing validation becomes a rather onerous task when you have a contact form, an event registration form, a sign in form, and so on and so forth.

Microsoft saw this coming, and they included a nice method of form validation within the .NET framework. The disadvantage there is that you’re still typing in validation code for each field in all of your forms. And what if you’re just not using .NET, what if you’re not even using any dynamic technology? Is there any easy way to validate all forms, once and for all?

Clearly this article wouldn’t exist were there not. So, I’m going to explain in gory detail two important and reusable methods: one for checking valid form data, the other for ensuring the proper data type is being entered.


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks
- Dynamic jQuery Styling

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials