ivFormValidator is an easy to use form validatior based on the jquery framework

Author: Ingo Volkmann www.godiv.de

licence: GNU GPLv3 or any later version

set the variables at the top of the function according to your needs

include this file in the head section of your website after the jquery include

<script type="text/javascript" language="javascript" src="scripts/iv_form_validation.js"></script>
- the form you'll check needs the class="ivFormValidator"
- all fields you want to check needs the class named like the requiredClassName variable in the top of the function
- to add options like compare or email syntax check, add the respective class names as a 2nd or 3rd class name of the input fields
- the script will add all needed event listeners, so all you need to do is to create the HTML markup

Example

simple input field which expects a number

a simple textarea

checking email syntax and compare it with an other entry

these input fields will be compared if the values are equal, it doesn't matter how much inputs you'll compare

same here with the password fields

even compare as many textareas as you need

there is no need to check radio buttons in my opinion because you can select one of them by default, so the user doesn't has a chance to uncheck all of them - but i decided to let the script check the radio buttons too - don't try to compare radio buttons, this can't succeeded in a valid result

also checkboxes will be checked

select boxes will be checked, if the value is not "" so if you want to check them, insert an option with the value="", otherwise it will be senseless

you can even compare select boxes if you want - doesn't matter how much

simple check, if the user has choosen a file