ANG Validator - jQuery form validation plugin
The jQuery form validation plugin makes easier to apply validations on html form field. It has many options for different types of validations like url, email, numeric type, file validation etc.
It provides easy way to apply custom validation options like inline css.
Getting Started
Include required files in head tag :
Initiate plugin using following code :
You can initialise plugin to override default settings :
;
Note: Here ".required" is the element selector you can use your own
Use html code as below :
You can apply custom options like inline css as below:
If you want to display error message in perticuar element :-
If you want to display custom error message :-
If you want to apply email validation :-
If you want to call custom function :-
If you want to apply file validaton with many options :-
List Of Custom Options :
- display-id : Id of element where error message to be displayed.
- msg : Message to be displayed when error.
- allowed-size : Maximum file size to be uploaded in KB for input type file.
- allowed-ext : Comma Separated value of allowed extensions for input type file.
- msg-size : Message to be displayed when size exceeded for input type file.
- msg-valid : Message to be displayed when value of input field is not valid.
- numeric : Value true or 1 . To take only numeric input.
- alphanum : Value true or 1 . To take only alpha numeric input.
- alpha : Value true or 1 . To take only alphabatic input.
- special-chars : Value true or 1 . To not accept special characters as input.
- url : Value true or 1 . Not accept input if not a valid url.
- email : Value true or 1 . Not accept input if not a valid email address.
- match-id : Match value of current input whith other input having id as defined.
- min-length : Check for minimum length.
- max-length : Check for maximum length.
- custom-function : Call custom function. Value should be name of function