Minimal Inline Form Validation Plugin For jQuery Valideater - Download Minimal Inline Form Validation Plugin For jQuery - Valideater

Download Minimal Inline Form Validation Plugin For jQuery – Valideater

Posted on

This time I will share jQuery Plugin and tutorial about Minimal Inline Form Validation Plugin For jQuery – Valideater, hope it will help you in programming stack.

Minimal Inline Form Validation Plugin For jQuery Valideater - Download Minimal Inline Form Validation Plugin For jQuery - Valideater
File Size: 9.06 KB
Views Total: 2103
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Valideater is a lightweight jQuery/HTML5 form validator that displays custom error / alert messages next to the invalid form elements when typing or clicking on the submit button.

Validation rules supported:

  • alpha: Value must be letters
  • alphanumeric: Letters and numbers required
  • characters4: At least 4 characters please
  • dob: Please give a valid date of birth
  • Email: Invalid email
  • matches: These values do not match
  • numeric: Value must be numeric
  • postcode: Invalid postcode
  • radio: Please choose an option
  • required: This information is required

Basic usages:

1. Download the jQuery Valideater plugin and include the jquery.valideater.js script on the web page.

1 <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
2 <script src="js/jquery.valideater-0.2.2.js"></script>

2. Add the validation rules to the form fields using data-vldtr attribute as follow.

1 <input type="text" placeholder="First name" data-vldtr="alpha">

3. Customize the error message using data-vldtr-RuleName attribute.

1 <input type="text" placeholder="First name"
2        data-vldtr="alpha"
3        data-vldtr-alpha="Custom message"
4        >

4. The plugin allows you to apply multiple validation rules at a time.

1 <input type="text" placeholder="Username"
2        data-vldtr="alphanumeric,characters4"
3        >

5. Prevent a specific form field from displaying alert message.

1 <input type="text" placeholder="Username"
2        data-vldtr="alphanumeric,characters4"
3        data-vldtr-alert="false"
4        >

6. Finally, you need to call the function on the form tag to active the validator.

1 $('form').valideater();

7. All the default plugin options. You can also pass the following options via HTML5 data attributes as noticed above.

01 // predefined error messages
02 'alpha':    'Value must be letters.',
03 'alphanumeric': 'Letters and numbers required.',
04 'characters4''At least 4 characters please.',
05 'dob':      'Please give a valid date of birth.',
06 'email':    'Invalid email.',
07 'matches':    'These values do not match.',
08 'numeric':    'Value must be numeric.',
09 'postcode':   'Invalid postcode.',
10 'radio':    'Please choose an option.',
11 'required':   'This information is required.',
12  
13 // live check
14 'livecheck':    true,
15  
16 // max age for DOB validation
17 'maxage':     122,
18  
19 // min age for DOB validation
20 'minage':     18,
21  
22 // display alerts
23 'alerts':     true,
24  
25 // CSS classes
26 'errorCssClass''js-vldtr-error',
27 'alertCssClass''js-vldtr-alert'

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

source : jqueryscript.net