Form validation using JavaScript has never been as easy and simple! We
have developed a free generic form validation script that can validate
any form with very little JavaScript required in form!
For example:
A normal HTML form with out validation:
<form action="foobar. htm" method="get">
<div>Name: <input type="text" name="customerN ame" value=""></div>
<div>Email: <input type="text" name="customerE mail" value=""></div>
<div>Zip: <input type="text" name="customerZ ip" value=""></div>
<div><input type="submit" value="Submit"> </div>
</form>
Simply add a few more attributes and you now have form validation:
<form action="foobar. htm" method="get">
<div>Name: <input type="text" required="yes" validate="text"
message="Please enter your name." name="customerN ame" value=""></div>
<div>Email: <input type="text" required="yes" validate="email "
message="Please enter a valid email address" name="customerE mail"
value=""></div>
<div>Zip: <input type="text" required="yes" validate="int"
message="Please enter a zip code" name="customerZ ip" value=""></div>
<div><input type="submit" value="Submit"
onClick="valida te(this.form); return document.formSu bmit;"></div>
</form>
You can get a free copy of the script here:
http://dboorn.com/javascript_form_va...n.php?catID=69. Please feel
free to download and use for any of your needs. As always please feel
free to let me know your thoughts!