Plugins

The plugins site is currently in development.

We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.

disable


Form dependancies

This plugin allows you to make a form element disabled if specified condition is not satisfy, and enable it as soon as it is.
Currently available conditions are :

  • checked
  • empty
  • disabled
  • hasCssClass
  • lt (lower than)
  • lte (lower than or equal)
  • longer (stricly longer)
  • shorter (strictly shorter)
  • length

All conditions can be negated using ! operator.
Limitations :

  • Conditions can only apply to one element. For example, it is not possible to compare two fields values.
  • You can only refer to an element by its ID (I know, this is stupid !)

This plugin does not perform any validation of any kind.

Further development will allow user to select an element for condition using jQuery selectors, to check conditions on more than one element, apply a custom style, hide rather than disable, execute a custom callback, ...

Sample uses :

jQuery disable()

Plugin allowing easy disabling/enabling of form fields.
Usage:

$('input').disable(); //disables
$('input').enable(); //enables
$('input').toggleDisabled(); //toggles
$('input').toggleEnabled(); //toggles
$('input').toggleDisabled(true); //disables
$('input').toggleEnabled(true); //enables

jQuery Enable Disable Plugin

jquery enable disable plugin is a simple, flexible and powerful tool. you can disable or enable easily an input, textarea or another form element by using a radio button, checkbox or a drop-down list.

tested with 1.2.x and 1.3.x

drop-down list support was added by Ajay Sawant thank you!

Toggle Button

A simple plugin for toggling the content and functionality of a link or button
element.

Useful when disabling links or submit buttons, or when responding to a user's
interaction.

E.g. User clicks a button, text changes to inform them that something is going
on, and button is disabled to prevent further clicks.

USAGE:

$('#element).toggleButton();

Upon first call, element will go to toggled state. Second call will restore to
normal.

Parameters can also be passed:

$('#element').toggleButton({ text: 'Processing...',
className: 'disabled',
preventClick: true
});

text - The text value which replaces the button text in the toggled state.
className - CSS class name corresponding to the toggled state
preventClick - Prevent clicks once toggled.

Disabler

Just a slim plugin I wrote because I got tired of writing a utility function to use with each().

Use:

$().disable();
$().enable();