Wednesday, October 7, 2009

JavaScript : Form Validation 3

The idea behind JavaScript form validation is to provide a method to check the user entered information before they can even submit it. JavaScript also lets you display helpful alerts to inform the user what information they have entered incorrectly and how they can fix it. In this lesson we will be reviewing some basic form validation, showing you how to check for the following:

º Checking for Non-Empty text input
º Checking for All Numbers
º Checking for All Letters
º Checking for Numbers and Letters (alphanumeric characters)
º Restricting the Length (length of a username and/or password)
º Selection Made (drop down selector)
º Email Validation
º All at Once (check all above when the user has completed filling out the form )

This site provide demo of the script.
http://www.tizag.com/javascriptT/javascriptform.php

No comments:

Post a Comment