Home arrow JavaScript arrow Universal Form Validation

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 / 26
February 02, 2004
  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

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

- Project Nashorn to Make Java, JavaScript Wor...
- JavaScript Virus Attacks Tumblr Blogs
- Google Releases Stable Dart Version, JavaScr...
- Khan Academy Unveils New JavaScript Learning...
- Accessing Nitro? There`s an App for That
- JQuery 2.0 Leaving Older IE Versions Behind
- Fastest JavaScript Engine Might Surprise You
- Microsoft Adjusting Chakra for IE 10
- Brendan Eich: We Don`t Need Google Native Cl...
- An Overview of JavaScript Statements
- An Overview of JavaScript Operators
- Overview of JavaScript Variables
- More of the Top jQuery Social Plugins
- The Top jQuery Social Plugins
- More of the Top jQuery Slider Plugins

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


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