Lets get you ready to use main jFormVal features in 5 minutes.
We have two usage modes, 'alert' and 'style.
Now that we are using alert mode, we need the bundle file, which has all the messages needed, in different languages. You can download it here.
To use a specific language, set up the lang variable.
Here we go to the validation itself.
Currently (at v0.5) we have four elements that can be validated:
Each one supports different validation methods, you can have a better description on the complete guide.
All validations work the same:
Lets validate a CheckBox whose name is 'prefs':
1. Select it:
2. Give it a name:
3. Add restrictions:
Now we have:
Get 'prefs', name it 'preferences' and assure that at least 2 and no more than 4 will be selected
That will return true if the validation is ok and false if an error has occurred. Also, in the case of an error, an alert will pop-up saying something like: 'You should check at least 2 options from Preferences'.
Lets get the full picture
jVal.alert = true;
jVal.style = false;