PURPOSE:

This code provides client-side text-field validation using VBscript and regular expressions.
It also allows you to use other intrinsic VBscript functions as well as a thorough function that checks for a valid e-mail address.

INPUTS:

To use this code, you must add two new attributes to the <INPUT> elements. 
VALIDATE and PATTERN (explained in code comments)

If you want a given "text" or "hidden" field to not be validated... you must still provide a VALIDATE attribute.
example: <INPUT TYPE="text" VALIDATE="none" ID="comment">


RETURNS:

The code will either allow the form to submit (if the data is clean) or a msgbox will pop-up explaining the errors. The code also changes the background color of the text box that contains an error.

EXPLANATIONS & ASSUMPTIONS:

You must be using IE 5. The example that is included in the zip file contains an .asp file, so you need to put the files in the root directory of an IIS box, or PWS. The "look.asp" file is the file you need to view first. The other 3 files are simply external script files.
Right now, this code will only validate "text" and "hidden" fields. Radio buttons, check-boxes, and select boxes are not included in the validation.


Mike Loffland
mloffland@hotmail.com
10/25/2000