🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

validex.js is a really small jQuery form validation plugin which highlights the form fields when the values typed by the user are invalid.

Form-Validation

Documentation

validex

jQuery plugin for validation inputs by regular expression.

Example work

Usage

Example #1 with options

  $('#fullname-input').validex({     pattern: '^[a-zA-Zа-яА-Я\\s]+$',     target: '#fullname-group',     onValid: function(input, target) {       $(target).removeClass('has-error');     },     onNotValid: function(input, target) {       $(target).addClass('has-error');     }   });

If regular express condition does not work, run method onNotValid and for element #fullname-group set class has-error.

Class has-error used to Bootstrap 3.

Example #2 with regular express in attribute [data-validex]

  $('#twitter-input').validex();
  <input type="text" id="twitter-input" value="@archakov06" placeholder="Enter Twitter username" data-validex="^@([A-Za-z0-9_]{1,15})+$" class="form-control">
All methods
  • onValid
  • onNotValid
  • condRequired
  • onBefore
  • onAfter

You May Also Like