guards.js

View the Project on GitHub on-site/guards.js

Global Functions

guard

signature: jQuery.guard(selector)

available since: 1.0.0

Guard elements with the given selector when the form is guarded. This is the way to add new guards to form inputs. It returns a Guards instance which has chainable methods to define the attributes of the guard.


Required field

enableGuards

signature: jQuery.enableGuards(selector)

available since: 1.0.0

Enable guards for a given selector. This will turn on live submit events to guard the children of the selected forms/elements. Since these are live events, this function need not be called when the elements actually exist (so they need not be in a DOM onready handler).

disableGuards

signature: jQuery.disableGuards(selector)

available since: 1.0.0

Disable guards that was previously enabled for the given selector.

liveGuard

signature: jQuery.liveGuard(selector)

available since: 1.0.0

Enable live guards for a given selector. This will turn on live submit, change and blur events to guard the children of the selected forms/elements. Since these are live events, this function need not be called when the elements actually exist (so they need not be in a DOM onready handler).

disableLiveGuard

signature: jQuery.disableLiveGuard(selector)

available since: 1.0.0

Disable live guards that was previously enabled for the given selector.