| Javascript Form Validation Tool ver 2.5 | |
|
by Artswork I must apologize for the fact that I am no longer able to accept email questions about my script where I would afford many hours to helping people properly integrate this module and writing additional items for anyone. This has occurred since the email worms of August 2003 severely compromised my email address displayed here attacked to where I had to deal with thousands of erroneous returned emails a day. I may periodically try to turn it back on so please return or try again after the dust settles. I also must state how people with our skills can ruin and incredible idea such as the internet for communication is disparaging. I have tried for many years returning contributions to others for my success working upon this medium. Thanks to all the interest I have received. This form validation tool can check for required, integer, email and date fields in your forms. It is easily portable to all your forms and will help save server side resources from form field validation and page reloads. All the messages are customized in the hidden form element where you also select the validation requirement. You can mix the required element with any of the other elements. This code is completely portable and can be used with any form by just adding your hidden elements appropriately and adding the onClick command to a button. | |
| Following the rules. | |
|
1) To set a required field use your existing field name and add
an r_ to the beginning of the field name and create a hidden element. EXAMPLE: <input type="text" name="your_fieldname"> <input type="hidden" name="r_your_fieldname" value="Required error message goes here">
2) To set an integer field use your existing field name and add
an i_ to the beginning of the field name and create a hidden element.
3) To set a date field use your existing field name and add an
d_ to the beginning of the field name and create a hidden element. This
date field only accepts the format MM/DD/YY or M/D/YY. | |
| Initialization of the script. | |
|
You MUST use the type="button" NOT THE type="submit" for your SUBMIT button, the javascript sends the submit for you. EXAMPLE: <input type=button Value="Button Message Here" onclick="check(form,form.elements.length)"> This sample utilizes all three validation tools in combination.
|