jQuery Form Validator
This plugin was created to minimize javascript logic in the html code when dealing with front-end validation of form data.
Usage example
Live demo
Features
- validate_url
- validate_date — yyyy-mm-dd (format can be customized, more information below)
- validate_birthdate — yyyy-mm-dd, not allowing dates in the future or dates that is older then 122 years (format can be customized, more information below)
- validate_email
- validate_time — hh:mm
- validate_domain — domain.com
- validate_phone — atleast 7 digits only one hyphen and plus allowed
- validate_swemob — validate that the value is a swedish mobile telephone number
- validate_float
- validate_int
- validate_length — Validate that input length is in given range (length3-20)
- validate_confirmation
- validate_spamcheck
- validate_ukvatnumber
- validate_swesec — validate swedish social security number
- required — no validation except that a value has to be given
- validate_custom — *Validate value against regexp (validate_custom regexp/^[a-z]{2} [0-9]{2}$/)
- validate_num_answers — Validate that a select element has the required number of selected options (validate_num_answers num5)
- Show help information automatically when input is focused
- Validate given values immediately when input is blurred.
- Make validation optional by adding attribute data-validation-optional=”true” to the element. This means that the validation defined in data-validation only will take place in case a value is given.
- Make validation dependent on another input of type checkbox being checked by adding attribute data-validation-if-checked=”name of checkbox input”
View on Github
View on jQuery.com