A jQuery Form Validation Plugin quickValidation.js works in a way It doesn’t defines the rules in the Javascript, instead they are assigned directly by using a data-validate attribute in the input tag. I assign them right in the input itself. Using a data-validate attribute in the input tag, you can string together rules like this required,number,range=0-99, then add the .quickValidate class, add a data-name attribute to name your field for errors, and you’re done.
Table of Contents
How to use :
1. Add Script :
<script src="jquery/1.8.2/jquery.min.js"></script>
<script src="js/jquery.quickValidate.js"></script>
2. Add Html :
<input type="text" name="Name" class="quickValidate" data-validate="required,number,range=0-99" />
3. Add script for validation :
$('form').quickValidate();
4. OPTIONS
class | Class of inputs being validated, default: .quickValidate |
notificationClass | Class of notification popup default: .notification |
errorClass | Class of error text in notification default: .error |