Friday, May 31, 2013

Inline Form Validation With jQuery

Position Absolute is sharing an easy to use form validation engine built with jQuery.
It offers a flexible way of displaying errors that will possibly match any type of form design. When the script detects an error, it creates a div, positions it at the right-top corner of the input & displays it like a tooltip with the error message inside.

Validation rules are created inside the classes of every input field like:
<input class="validate[required,custom[onlyLetter],length[0,100]]" name="first" type="text" />

It currently support rules like:

  • required
  • length
  • telephone
  • email
  • onlyNumber
  • onlyLetter
  • & more
Also, you can define custom rules via RegEx & error messages can be localised with custom language files.


No comments :

Post a Comment