Licence: Apache License, Version 2.0
Demo: http://dev.maxschuster.eu/jQuery.validator/
Client-Side Form Input validation jQuery Plugin.
https://github.com/maxschuster/jQuery.timer
Initializes the validator plugin on the given set of jQuery elements with the given set of options
$('selector').validator(options);
Parameter | Type | Description |
---|---|---|
options | Object | Settings with which the plugin should be initialized (see Settings) |
jQuery Object To provide chainability.
Checks if every matching element (that has jQuery.validator initialized on it) has a valid value.
$('selector').validator('valid');
none
Boolean True if all elements are valid or false if not.
Enables the form checking for the given set of jQuery elements.
$('selector').validator('enable');
none
jQuery Object To provide chainability.
Disables the form checking for the given set of jQuery elements.
$('selector').validator('disable');
none
jQuery Object To provide chainability.
Completely removes the form checking for the given set of jQuery elements.
$('selector').validator('destroy');
none
jQuery Object To provide chainability.
Name | Type | Default | Description |
---|---|---|---|
ajax | String | Boolean | false | Url of the ajax file. File has to return true or false as json. |
liveCheck | Boolean | false | If true the check will be triggred on every keydown, keyup, keypress, change and blur event. If it is false the check will only be executed of every change and blur event. |
mask | String | RegExp | 'required' | The regular expression which the contents of the input will be matched against is. Can be a self-defined regular expression or the name of a predefined expression (eg email). |
optional | Boolean | false | If true then the value could be empty. |
rel | jQuery Object | Boolean | false | Defines that the current element is related to another element and must have the same value. Used for "Retype Password" fields. |
predefinedMasks | Object | {'email': ..., ...} | Contains predefined regex mask with their name as key. (See predefinedMasks) |
Name | Description |
---|---|
Value must match the email format | |
required | The value must not be empty |
zip_code_ger_and_at | The value must match the german or austrian zip code format |
no_white_space | The value must not contain whitespaces |
number | The value must be a number "." and "," allowed. |
integer | The value must be an integer. |
date_day_month_year | Date in the format D(D).M(M).YYYY. |
date_year_month_day | Date in the format YYYY-MM-DD. |
More suggestions are allways welcome... ;-)
Gets triggered if the value of the input has become valid.
Gets triggered if the value of the input has become invalid.
Gets triggered if the current value of the input has been checked.
Added to every element that has jQuery.validator attached.
Added to every element that has an invalid value.