Important alert: (current site time 7/15/2013 12:53:01 PM EDT)
 

winzip icon

A Universal Form Validator

Email
Submitted on: 2/13/2003 5:52:18 PM
By: Wes Grant  
Level: Intermediate
User Rating: By 6 Users
Compatibility: JavaScript
Views: 28832
 
     This is a script that can be used to validate almost any form using hidden fields to describe how to validate the controls in the form. The script validates for required fields, Numbers with a Min/Max value if needed, 10 digit phone numbers with any seperators (and formats the phone number after validation), properly formed email address, dates with min and max values, and age fields with min and max values. There are also many options on how to report errors (ie: Popup-Summary, Color cues on the input boxes and text labels to describe the error.) I cannot figure out how to format a complete description of the code here so I have written a description of how to use it here: http://www.wesgrant.com/wes/validation.asp

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
2/14/2004 3:33:29 PM

Its helpful
(If this comment was disrespectful, please report it.)

 
3/1/2004 4:52:57 PM

visit this link and donīt say this idea is yours.

http://www.codeproject.com/asp/formvalidator.asp
(If this comment was disrespectful, please report it.)

 
8/18/2004 2:01:55 AM

5 stars from me, sweeeeeeeeet.

Thanks...
(If this comment was disrespectful, please report it.)

 
2/22/2005 2:09:17 AM

duhh.. how can i use this?
(If this comment was disrespectful, please report it.)

 
5/18/2008 12:30:19 PMCooper

Hi, it's very useful code, but how to make output like this. 10.000 in the text field
while user input in the text field 10000 on the same time. Not after got enter or lose focus from it.

please can you give some sample.

thanks.

Peace from Indonesia
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.