Description

Home

Welcome to jFormVal

JFormVal is jQuery Plugin for form validation.
It has been tested on all major browsers and works wonders!

Main features:
  • One line validation with method chaining
  • Bundle for error messages in different languages
  • Auto change css style of elements
  • Easy configuration

Short example:
jQuery('#i01').valText('City').min(1).dif('Chicago').max(20).err('#dv1');

<form>
<div id="dv1">
<input type="text' id="i01" name="country" />
<input type="text' id="i01" name="city" />
<input type="submit" />
</div>
</form>

This sample validates the element which id is 'i01'. It is a 'text field' as the function 'valText' implies.
We gave it the name 'City', so it can have a nice error message, and set the following restrictions:
  1. It must be at least 1 character in length (in other words: It has to be filled in)
  2. Must be different from 'Chicago'
  3. Can't have more than 20 characters
Also there is a 'error element', which is the element that will actualy have its css changed, since we could want a table column or a div, instead of the element itself, to be colored red for example. In this case it would be the '#dv1' div.

Another example:
Here we have a sample of validation style and alert, of course you can change the style to whatever you want, and, since v0.6, the alert function cam be replaced by any function, including your own!!!



Usage