Powerful Multi-Functional Form Validation Plugin - jQuery Validation

Powerful Multi-Functional Form Validation Plugin - jQuery Validation
File Size: 1.13 MB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

jQuery Validation is a javascript based plugin that helps you implement a powerful client side validator to your form elements that validate the value ( name, email, address, etc..) your user input when submitting.

You might also like:

Installation:

# NPM
$ npm install jquery-validation

# Bower
$ bower install jquery-validation

Basic Usage:

For more advanced usages, please check our more example pages list below.

1.  Include jQuery library and jquery.validate.js in your <head> tag

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="../jquery.validate.js"></script>

2. Markup html structure

<form class="cmxform" id="commentForm" method="get" action="">
<fieldset>
<legend>Please provide your name, email address (won't be published) and a comment</legend>
<p>
<label for="cname">Name (required, at least 2 characters)</label>
<input id="cname" name="name" minlength="2" type="text" required />
<p>
<label for="cemail">E-Mail (required)</label>
<input id="cemail" type="email" name="email" required />
</p>
<p>
<label for="curl">URL (optional)</label>
<input id="curl" type="url" name="url" />
</p>
<p>
<label for="ccomment">Your comment (required)</label>
<textarea id="ccomment" name="comment" required></textarea>
</p>
<p>
<input class="submit" type="submit" value="Submit"/>
</p>
</fieldset>
</form>

3. Call the plugin

<script>
$().ready(function() {
	$("#commentForm").validate();
});
</script>

More Examples:

Change logs:

v1.16.1 (2017-04-08)

  • Update

v1.16 (2016-12-02)

  • support jQuery 3+

v1.15.1 (2016-07-23)

  • Fix multiple mime-type validation
  • IBAN require at least 5 chars
  • Correct notEqualTo jQuery reference
  • Added failing test
  • Fix group validation with 3 and more fields
  • Fix regressions
  • Update step validation to handle floating points correctly
  • Fix error when calling $.fn.rules() on a non-form element
  • Call errorPlacement in validator scope
  • Fixed issue with contenteditable elements in forms where events for single input validation would cause exceptions
  • Added Azeri language

v1.15.0 (2016-02-25)

  • Fixed code style issues
  • resetForm should also remove valid class from elements.
  • Unhighlighting field if already highlighted when using remote rule.
  • Bind the blur event just once in equalTo rule
  • Fixed error when calling .rules() on empty jquery set.
  • Fix handling of error messages with input groups.
  • Fix TypeError in showLabel when using groups settings
  • Adding a way to pass method name to remote
  • Validation fails to trigger when next field is already filled out
  • Required rule take precedence over number & digits rules
  • Error hidden but input error class not removed
  • Remote validation uses wrong error messages
  • Fixed field highlighting with remote validation.
  • Fixed :filled selector for multiple select elements.
  • Added doc reference to jQuery.validator.methods
  • Move message processing from formatAndAdd to defaultMessage
  • ErrorList should contain only the errors that it should
  • Extract the file name without including "C:\fakepath\"
  • HTML5 step attribute support.
  • Added support for "pending" class on outstanding requests
  • Added normalizer 
  • Split out creditcard method
  • Escape errorID for use in the regex, not to build aria-describedby
  • Escape single quotes in names avoiding a Sizzle Error being thrown
  • Instead of using validating field's value to skip api call, use the serialized data object of the request
  • Add support for contentEditable tags
  • BIC: allow digits 1-9 in second place of location
  • Accept method regex should be escaped properly.
  • Case-insensitive check for BIC
  • Correct postalCodeCA to exclude invalid combinations
  • Make postalCodeCA method more lenient
  • Added Macedonian localization.
  • Added missing pattern message in Polish (adamwojtkiewicz)
  • Fixed Persian translation of min/max message.
  • Updated messages_sk.js
  • Update Malay translation
  • Included messages from additional methods
  • Improving pt_BR translation and fixing a typo on the 'cifES' key.

v1.14.0 (2015-06-26)

  • Remove unused removeAttrs method
  • Replace regex for url method
  • Remove bad url param in $.ajax, overwritten by $.extend
  • Properly handle nested cancel submit button
  • Fix indent
  • Refactor attributeRules and dataRules to share noramlizer
  • dataRules method to convert value to number for number inputs
  • Update url method to allow for protocol-relative URLs
  • Remove deprecated $.format placeholder
  • Use jQuery 1.7+ on/off, add destroy method
  • IE8 compatibility changed .indexOf to $.inArray
  • Cast NaN value attributes to undefined for Opera Mini
  • Stop trimming value inside required method
  • Use :disabled selector to match disabled elements
  • Exclude some keyboard keys to prevent revalidating the field
  • Do not search the whole DOM for radio/checkbox elements
  • Throw better errors for bad rule methods
  • Fixed number validation error
  • Fix reference to whatwg spec
  • Focus invalid element when validating a custom set of inputs
  • Reset element styles when using custom highlight methods
  • Escape dollar sign in error id
  • Revert "Ignore readonly as well as disabled fields."
  • Update link in comment for Luhn algorithm

This awesome jQuery plugin is developed by jquery-validation. For more Advanced Usages, please check the demo page or visit the official website.