JavaScript
  Home arrow JavaScript arrow Form Validation with JavaScript
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Developerworks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Form Validation with JavaScript
By: Nariman K, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 266
    2003-12-01

    Table of Contents:
  • Form Validation with JavaScript
  • Check Point
  • Object Lessons
  • Rock On
  • Hammer Time
  • How Things Work
  • A Little Space
  • Expressing Yourself
  • Under Construction
  • A Quick Snack

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    PCmover - $15 Off with Coupon Code CJPH7Q

    Form Validation with JavaScript
    (Page 1 of 10 )

    So you finally get that site of yours up and running, and sign up about fifty users for your services. You browse through the database entries, only to realize that most of the user information provided is incorrect, with email addresses that read "somewhere#something.com," telephone numbers that read "abgedaf," or birthdates saying that the applicant was born yesterday.

    Where did you go wrong? The answer lies between the user submitting his or her registration and the data reaching the database. You neglected the important intermediate step of form validation.

    Today, most sites that require user input, be it for a simple mailing list or a more complex online shopping system, use form validation to cut down on instances of erroneous data entering their system. Although there is no concrete way of identifying authentic data, form validation helps identify (to a large extent) the authenticity of the type of data entered, thus cutting down on the amount of "bad" data that gets into the database.

    That's where this article comes in. Over the next few pages, I'll be attempting to build a reusable library of functions for client-side form input validation, in an attempt to save you some time the next time an application needs to have its input checked for errors. The end result of this experiment will be a JavaScript object that can be easily included in your scripts, and that exposes basic object methods for data validation. It may not meet all your needs; however, the process should be instructive, especially if you're new to object programming in JavaScript, and you'll have very little difficulty customizing it so that it works for you.

    Let's get going!

    More JavaScript Articles
    More By Nariman K, (c) Melonfire


     

       

    JAVASCRIPT ARTICLES

    - Getting Attention with Interactive Effects
    - Interacting with Tooltips and Previews
    - Just-in-Time Information and Ajax
    - Interactive Effects
    - Using Cookies With JavaScript
    - Understanding the JavaScript RegExp Object
    - Controlling Browser Properties with JavaScri...
    - Using Timers in JavaScript
    - Form Validation with JavaScript
    - JavaScript Exception Handling
    - Stringing Things Along
    - Understanding The JavaScript Event Model (pa...
    - Understanding The JavaScript Event Model (pa...
    - An Object Lesson In JavaScript

    Iron Speed



    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway