Welcome to jFormVal
JFormVal is jQuery Plugin for form validation.
It has been tested on all major browsers and works wonders!
- One line validation with method chaining
- Bundle for error messages in different languages
- Auto change css style of elements
- Easy configuration
<input type="text' id="i01" name="country" />
<input type="text' id="i01" name="city" />
<input type="submit" />
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:
- It must be at least 1 character in length (in other words: It has to be filled in)
- Must be different from 'Chicago'
- 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.
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!!!