Home arrow JavaScript arrow Page 5 - 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 - And Knowing is Half the Battle
(Page 5 of 5 )

In this example, I’ve removed the prefixes ‘data_’ and ‘process_’ from the fields, and therefore commented that part out of the form checker. I had these in place for the use of universal form handlers. You are beginning to suspect that I like to use the word ‘universal’, and you’re right; it makes things sound big and important.

Anyway, these handlers took the form of mail processors, dynamically generated forms for various uses within a Content Management System, and for other non-interesting items like surveys and such.

My philosophy is that if you put enough thought and work into something, you should be able to use it again and again with the greatest of ease. And if you want to make a modification (eg: adding the regular expression to check email addresses) you only have to change that in one place, not in a million forms within your application.

You should be able to copy & paste this code directly into your own ‘forms.js’ without any further configuration needed. I have no doubt however that you will make many marvelous modifications to suit your own very unique needs. Feel free to drop me a note, and share any that you have found particularly useful!

DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

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