Easy jQuery Form Validation Plugin - valideasy

Easy jQuery Form Validation Plugin - valideasy
File Size: 12.8 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

valideasy is a simple and easy jQuery plugin that adds form validation functionality to your input fields just by adding rule class attributes to your form fields. The plugin comes with various default error messages for different types of validation rules, you can also easily customize them via data-error-fieldname and data-error-message-{rule} attributes.

Supported rules:

  • Required input field
  • Email
  • Telephone
  • Number
  • Integer
  • Website URL
  • Zip code
  • At least one field required
  • Values comparison : lower than ou greater than

Basic Usage:

1. The valideasy plugin requires the jQuery library already loaded. 

<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="js/jquery-valideasy.min.js"></script>

2. Create a input filed with a rule class.

<form>
<input class="{rule}" id="email" title="Your Email" type="text" value="Your Email" />
</form>

3. Call the plugin with options.

$('form').submit(function(){
var formIsValid = $(this).valideasy( {
  mode: 'single', // How error messages are displayed. single or unified
  errorElementId: 'errors', // Indicates the ID of the field(s) supposed to display error messages.
  disableFieldStyle: false, // Set to true to stop adding the .error class to fields with errors
  stepByStep: false, // Set to true to stop validation at first error
  scrollToFirstError: false, // Set to true to auto scroll to the first error field at the end of the validation process
}} );
return formIsValid;
});

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