Get new jQuery plugins just once a week



April 11, 2014

guards-js | jQuery plugin to guard forms against invalid user input

Guards-js is a plugin for jQuery that provides a simple, chainable, declarative API for guarding your forms against invalid user input.All guarding happens via delegated events, which means the elements need not yet be defined. They can be defined later on, or even be added to the DOM after some user input.
Some guards can take options which affect how the guard behaves. The “int”, “float”, and “moneyUS” guards can have min, max or min and max options which determine the acceptable range of those inputs. Note that these numeric guards (along with most guards) will pass if no input is provided. You must use the required guard along with them if you want no input to cause an error. There is no problem using multiple guards against a single field.

Example Code :-

$.guard("#form1 input[name='input1']").using("required").message("ERROR'D!!!");

Created by On-site



guards-js jquery plugin



Related posts:

Dante Editor
guards-js jquery plugin

jQuery plugin

Sign up for our weekly newsletter.

* We won't spam you ever
Couple Gift Ideas