Big Resources
 BoxedArt
 123Webmaster
 A1Javascripts
 1-Click-Clipart
 FresherImage
 FontFiles
 HTMLforums
 httpCITY
 PerlAccess
 HostRaiders
 
 
BigResources Somewhat Weekly Ezine



 
  Link to Us
Contact Us
Advertise
Careers
Submissions
Privacy
Free Email Signup
Free Email Login
 
 

  ::Other Resources:

Turnkey Websites
Stock Photos
CMS Templates
Top 25 Web Hosts
Web Design Tutorials
Webmaster Resources
Javascripts
Website Reviews
DHTML Scripts
Free Web Templates
Web Templates
Internet Provider
Web Hosting Provider
Broadband Internet
Online Shopping
Create a free forum
Zoekmachine Optimalisatie

 


Unlimited Web Templates

All access to thousands of web templates, logos, icons, more...


Royalty Free Stock Photos

All access to thousands of professional stock photos


Turnkey Website Templates
Fully scripted PHP website templates!

<script language="Javascript">
   Example of the form validation script

</script>

<<Back Download This .Zip File
Or get this script emailed to you, enter your email address and press the button.
Your Email Address:

This script will validate your form fields to make sure they are filled in and alert the user if they are not.
By Jacob at Big Resources.

Below is a simple form where some of the fields are required to 
be filled in, you will see how it works.
It is easy to configure to your
needs and more or less checks can be added.

First Name:
Last Name:
Address:
City:
State:
Country:
E-Mail Address:
Most configuration details are in the script, however, here are a few more.

Changing it to suit your form:
1) Look for the name of your form, it will look something like this:

thisismyformname">
2) In the script, change this part of the script
if ((document.onlineform.name.value=="")
to your form name.
3) Now you have if ((document.thisismyformname.name.value=="") , change this for each entry.

Adding Your checks:
This is done with this part of the script:
if ((document.thisismyformname.name.value=="")
this will currently check to make sure a field called "NAME" is filled in. If you have a field name called "PhoneNumber", then you change it like this.
if ((document.thisismyformname.PhoneNumber.value=="")

Adding More Checks:
Add more checks like this. IE, for a field name called "address", you would add this:
{
if ((document.thisismyformname.name.value=="")||
(document.thisismyformname.phone.value=="")||
(document.thisismyformname.address.value=="")||
(document.thisismyformname.email.value==""))
{

Adding The Second Part to your Form:
Next you have to add this to your form: onSubmit="return validateform( this.form )"
If your form looks similar to this:

add it like this:
onSubmit="return validateform( this.form )" enctype="text/plain">

---------------------

 

Please Visit Our Partners

Free Sony VAIO Laptop Computer - Win a free Sony VAIO laptop computer. No purchases necessary and free to enter.

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. A1 JavaScript Resources is independent of Sun Microsystems, Inc.

Click Here!

Copyright.©2002.BIG RESOURCES