jQuery plugin to allow radio buttons to be unchecked

Diego's picture

This plugin works great for when you have options that need to be unique but also need to be able to get turned off or deleted.

In my case, I was designing a custom user authorization system, and I needed to define certain rules for specific roles, but I wanted to be able to uncheck the rules to imply a restriction.

So I whipped up this plugin so I could do something like this:

Usage:

  1. jQuery(document).ready(function(){
  2.   jQuery('.acts_as_checkbox').checkboxify();
  3. });

The plugin maintains radio group functionality, which is what makes radio buttons useful. By giving a group of radio buttons a common name attribute, you can ensure that only a single radio button out of the group is checked at a time.

This was just a simple little plugin that I use at work, so I decided to put it out for other devs to find and use. Let me know what you think!

You can check out my plugins on github or download this plugin directly.


SmemeDiurnben's picture
...

Unadulterated words, some true words man. You rocked my day!

Submitted by SmemeDiurnben (not verified) on Fri, 12/11/2009 - 19:55.
payday loans's picture
Lots of new info

I love this blog. www.greyrobot.com is very informative. The article is very professionally written. I enjoy reading www.greyrobot.com every day. faxless payday loan canada

Submitted by payday loans (not verified) on Mon, 11/30/2009 - 17:43.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <pre>, <c>, <css>, <drupal6>, <html>, <javascript>, <mysql>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options

CAPTCHA
You're human, right?
9 + 6 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

 Check it Out!
Future of Web Apps - Miami 2010

RSS

Syndicate content

RSS, XHTML, CSS

Copyright © 2009 Grey Robot, Inc.