Accessible, Custom Designed Checkbox and Radio Button Inputs Styled with CSS (and a dash of jQuery)

Posted by Maggie on 07/01/2009

Styling checkbox and radio button inputs to match a custom design is nearly impossible because neither reliably supports basic CSS, like background colors or images; it’s even a challenge to get the margins to appear consistently across browsers. To remedy this we developed a concise jQuery plugin based on progressive enhancement that leverages an input element’s built-in functionality and accessibility features and works in all modern browsers without added markup or mandatory CSS classes.

In the past few years web application interface designs have evolved from flat metal gray to having rich color palettes and dimensional background images thanks to the adoption of web standards and advanced CSS techniques. Form checkboxes and radio buttons have lagged behind, though, because only a few browser vendors have built in support for styling these elements with CSS, and inconsistently at that. A quick search turned up several workaround scripts that cleverly use a combination of JavaScript and CSS to apply a custom skin to these form elements, however they sometimes do more work than we need them to by inserting replacement markup, or requiring that specific classes be assigned to every applicable form element.

When considering how to build our own customized input script, we set out to do as little as possible — on their own, checkboxes and radio buttons capture data and display feedback, and we wanted to use that native functionality and not reinvent it using JavaScript. If we let the user interact with the inputs as expected, we’d only have to apply a lightweight script to layer on visual enhancements for richer feedback. And by keeping our hands off the inputs’ native functionality, we were able to preserve their inherent keyboard accessibility and avoid the need to use ARIA attributes since a screen reader is still interacting with the native form element.

Update: We’ve received a lot of thoughtful comments on this technique, one of which stood out: what happens when images aren’t available? In our first pass at this widget, we hid the input element by positioning it off the page, and then styled the label element with background images that mapped to click states (unchecked, hover, checked) – so it became an unusable input without images. We’ve since re-factored the markup and script to ensure that the widget works even when images don’t load. Instead of positioning the input off the page, we’ve positioned it directly behind the styled label, so if the label’s background image fails, the input remains visible. And because the label and input share a click event, when the user clicks the transparent label over the input, the input updates accordingly.


When JavaScript is enabled, users see custom input checkboxes and radio buttons as shown below; when users are browsing with JavaScript disabled or with a screen reader, they interact with standard, unstyled input elements.

jQuery CustomInput plugin demo by Filament Group


We start with basic HTML for each input that follows web standards conventions:

  • assigned a unique id and value to each input
  • paired the input with a label element
  • included a “for” attribute on each label that references the preceding input’s id

Each radio button input also needs a common name attribute to group it with a set.

        <legend>Which genres do you like?</legend>

        <input type="checkbox" name="genre" id="check-1" value="action" />
        <label for="check-1">Action / Adventure</label>

        . . .
        <legend>Caddyshack is the greatest movie of all time, right?</legend>

        <input type="radio" name="opinions" id="radio-1" value="1" />
        <label for="radio-1">Totally</label>

        . . .

Pairing the inputs and labels correctly is essential to how this plugin works. As stated in the HTML spec, “When a LABEL element receives focus, it passes the focus on to its associated control.” Browsers have standardized this behavior so that when you click a label, the click is passed on to the input — in other words, the label and input act as a single element when marked up this way. Because we don’t have to interact with the input directly, we can hide it from view with CSS and apply styles to the label to make it look like a customized checkbox or radio button.

When the page loads, the plugin script finds each input/label pair and wraps it in a div. Each wrapper div is assigned a class to it based on the type of input it contains:

<div class="custom-checkbox">
    <input id="check-3" type="checkbox" value="epic" name="genre"/>
    <label class="" for="check-3">Epic / Historical</label>


First, we absolutely positioned the input and label pair so that we could layer the label over the input, like a mask. For this to work, we relatively positioned the wrapper div to contain the input and label:

/* wrapper divs */
.custom-checkbox, .custom-radio { position: relative; }

/* input, label positioning */
.custom-checkbox input,
.custom-radio input {
    position: absolute;
    left: 2px;
    top: 3px;
    margin: 0;
    z-index: 0;

.custom-checkbox label,
.custom-radio label {
    display: block;
    position: relative;
    z-index: 1;
    font-size: 1.3em;
    padding-right: 1em;
    line-height: 1;
    padding: .5em 0 .5em 30px;
    margin: 0 0 .3em;
    cursor: pointer;

Next, we styled each type of label (checkbox and radio button) with a background image — we used an image sprite for all states: default, hover, and checked:

.custom-checkbox label {
    background: url(images/checkbox.gif) no-repeat;

.custom-radio label {
    background: url(images/radiobutton.gif) no-repeat;

And added classes for hover and checked states that repositioned the background sprite accordingly. We also included a class for the “focus” state for keyboard users.

.custom-checkbox label, .custom-radio label {
    background-position: -10px -14px;

.custom-checkbox label.hover,
.custom-checkbox label.focus,
.custom-radio label.hover,
.custom-radio label.focus {
    background-position: -10px -114px;

.custom-checkbox label.checked,
.custom-radio label.checked {
    background-position: -10px -214px;

.custom-checkbox label.checkedHover,
.custom-checkbox label.checkedFocus {
    background-position: -10px -314px;

.custom-checkbox label.focus,
.custom-radio label.focus {
    outline: 1px dotted #ccc;


Because the label-input association takes care of clicking the hidden input for us, we only had to write a really simple jQuery plugin that appends a class to each input on hover, on focus, and on click:

jQuery.fn.customInput = function(){
            var input = $(this);

            // get the associated label using the input's id
            var label = $('label[for='+input.attr('id')+']');

            //get type, for classname suffix
            var inputType = ('[type=checkbox]')) ? 'checkbox' : 'radio';

            // wrap the input + label in a div
            $('').insertBefore(input).append(input, label);

            // find all inputs in this set using the shared name attribute
            var allInputs = $('input[name='+input.attr('name')+']');

            // necessary for browsers that don't support the :hover pseudo class on labels
                    if(inputType == 'checkbox' &&':checked')){
                function(){ $(this).removeClass('hover checkedHover'); }

            //bind custom event, trigger it, bind click,focus,blur events
            input.bind('updateState', function(){
                if (':checked')) {
                    if (':radio')) {
                else { label.removeClass('checked checkedHover checkedFocus'); }

                if(inputType == 'checkbox' &&':checked')){
            .blur(function(){ label.removeClass('focus checkedFocus'); });


Simply call the customInput() method on any input element or group of elements (more on using jQuery):


Download the code

This plugin script requires jQuery’s core library, available for download at or link directly from Google’s code repository. Download the plugin script, customInput.jquery.js, and feel free to use it in your projects (it’s dual licensed under the MIT and GPL open source licenses; refer to author’s notes).



<div id="commentNumber1" class="commentEntry">
<p>I like this approach for radios &amp; checkboxes customization, it seems to be very lightweight, however i noticed that the checkboxes need a different visual state whenever they’re focused, which is necessary when you want to control them with the keyboard.

    <p class="posted"><a href="#commentNumber1">Comment</a> by

Jonathan Vitela on 07/02  at  06:16 AM

<div id="commentNumber2" class="commentEntry">
<p>Nice rendering (should i say as always ;)), hope to see something like that integrated in jquery-ui in a near future to get this consistent with ui-themes.

As a side note it would be nice to also add a different background for checked input when they’re hovered.

    <p class="posted"><a href="#commentNumber2">Comment</a> by

malko on 07/02  at  06:23 AM

<div id="commentNumber3" class="commentEntry">
<p>Filament Group has done it again! Nice work.

    <p class="posted"><a href="#commentNumber3">Comment</a> by

Marc Grabanski on 07/02  at  07:49 AM

<div id="commentNumber4" class="commentEntry">
<p>These custom inputs are pretty. I agree with Jonathan Vitela to add a different visual state to checkboxes and radio buttons when focused via the keyboard. Good job!

    <p class="posted"><a href="#commentNumber4">Comment</a> by

Rubens Mariuzzo on 07/02  at  08:00 AM

<div id="commentNumber5" class="commentEntry fg">
<p>@Jonathan @Rubens  Good feedback. The keyboard focus feedback is now updated to be lot clearer now—we added a dotted outline and flip the form element to the hover state.

    <p class="posted"><a href="#commentNumber5">Comment</a> by

Todd (Filament) on 07/02  at  09:18 AM

<div id="commentNumber6" class="commentEntry">
<p>Very nice, simple. Good effort.

    <p class="posted"><a href="#commentNumber6">Comment</a> by

redsquare on 07/02  at  09:34 AM

<div id="commentNumber7" class="commentEntry">
<p>I opened up Firebug and changed one of the labels to be multiple lines. I thought I would try it out since I’ve had issues in the past with multiple lines and using sprites for the different states.&nbsp; Having long labels may be an edge case but, I think, should also be accounted for.


Apart from this, your method seems to be the best that I have used or found elsewhere. Good work!

    <p class="posted"><a href="#commentNumber7">Comment</a> by

Tony on 07/02  at  10:03 AM

<div id="commentNumber8" class="commentEntry fg">
<p>Thanks Tony,

That’s definitely something to watch out for any time you’re using sprites. If you need this technique to work with really tall labels, the easiest way to “fix” it would be to space out the sprite images far enough to accommodate the label height, but of course that will always come with limitations. You cold also make the sprite horizontally spaced instead if that fits your design.
The other way would be to use jQuery to append a span element to the label, and then you could style that span with a width and height that will never grow, and put the background image on it instead of the label. This approach is more bulletproof I suppose, but we wanted to be as unobtrusive as we could with this script, so we decided against markup additions.

We may update this with a taller sprite though when we get time.

    <p class="posted"><a href="#commentNumber8">Comment</a> by

Scott (Filament) on 07/02  at  10:16 AM

<div id="commentNumber9" class="commentEntry">
<p>Top notch once again guys!&nbsp; Great work!

    <p class="posted"><a href="#commentNumber9">Comment</a> by

Jonathan Sharp on 07/02  at  10:17 AM

<div id="commentNumber10" class="commentEntry fg">
<p>@Tony  We just tweaked the image sprite to add an extra 100px between icons. Like Scott said, this approach isn’t as bullet-proof as adding an extra element for the icon but we like the simplicity in this case. The extra spacing should cover most reasonable cases and you can always adjust as needed for your project.

    <p class="posted"><a href="#commentNumber10">Comment</a> by

Todd (Filament) on 07/02  at  01:21 PM

<div id="commentNumber11" class="commentEntry">
<p>Awesome! I’m glad to see that you guys are so open to and quick to respond to feedback.&nbsp; In my current job, I have learned that you can never make any assumptions about data (especially the length of text and such). Thanks for your great work.

    <p class="posted"><a href="#commentNumber11">Comment</a> by

Tony on 07/02  at  01:26 PM

<div id="commentNumber12" class="commentEntry">
<p>Looks good, but it presents an inconsistent user experience when a checked input is hovered over (or tabbed to) - i.e. it requires a new, additional state which represents checked AND hovered, which should show the green (hover) border around the input, in addition to the check mark / dot.

Please implement this.

    <p class="posted"><a href="#commentNumber12">Comment</a> by

Marcus Tucker on 07/05  at  02:10 PM

<div id="commentNumber13" class="commentEntry">
<p>If the browser can not display images or they are off then inputs will be inaccessible. The checkbox and radio button will not be visible.

    <p class="posted"><a href="#commentNumber13">Comment</a> by

Cezary Tomczyk on 07/11  at  09:51 AM

<div id="commentNumber14" class="commentEntry">
<p>Very nice! This is similar to the project Uniform (<a href="" rel="nofollow"></a>). Any plan to support changing file inputs?

    <p class="posted"><a href="#commentNumber14">Comment</a> by

Matthew Irish on 07/22  at  10:35 PM

<div id="commentNumber15" class="commentEntry">
<p>What do you think of these modifications to the jquery plugin?

jQuery.fn.customInput = function() {
$(this).each(function(i) {

var input = $(this);

var radio =’:radio’);

// get the associated label using the input’s id
var label =’label’);

// necessary for browsers that don’t support the :hover pseudo class on labels
function() { $(this).addClass(’hover’); },
function() { $(this).removeClass(’hover’); }

if (input.attr("checked")) label.addClass(’checked’);

if (radio) {
// find all inputs in this set using the shared name attribute
var otherRadiosInGroup = $(’input[name=’ + input.attr(’name’) + ‘]’).not(’#’ +; {’label’).removeClass(’checked’);
else { {

input.focus(function() { label.addClass(’focus’); })
.blur(function() { label.removeClass(’focus’); });


    <p class="posted"><a href="#commentNumber15">Comment</a> by

Gabriel on 07/25  at  02:04 PM

<div id="commentNumber16" class="commentEntry">
<p>I love this idea… I extended it by getting rid of the div wrapper around the inputs. Now you only need the standard markup without any classes. You can check out a demo here:

Please let me know what you think?

Thanks guys,

    <p class="posted"><a href="#commentNumber16">Comment</a> by

Gabriel on 07/25  at  03:33 PM

<div id="commentNumber17" class="commentEntry">
<p>Wonderful.&nbsp; I second the request to have this integrated into jQuery UI for theme support.&nbsp; It’s easy enough to approach this solution using existing classes for checkboxes but the lack of rounded-corners support in IE makes it difficult to do for radio buttons.&nbsp; Full-fledged glyphs would help out a lot (and require less markup/DOM manipulations)!

    <p class="posted"><a href="#commentNumber17">Comment</a> by

Ken Browning on 07/30  at  05:01 PM

<div id="commentNumber18" class="commentEntry">
<p>Nice.... very nice!!!


    <p class="posted"><a href="#commentNumber18">Comment</a> by

Vinidog on 08/02  at  10:21 PM

<div id="commentNumber19" class="commentEntry">
<p>This is absolutely great. Thank you so much for working this out.

Fileuploads and normal Textfields seem to be the only basic things missing in the for stylable themeroller compatible form elements.

    <p class="posted"><a href="#commentNumber19">Comment</a> by

tronics on 08/09  at  04:20 PM

<div id="commentNumber20" class="commentEntry">
<p>Just wanted to send a thanks to Filament Group  for creating such an easy to use plugin.. and Gabriel for simplifying it even further. It is working for me like a dream so far!

    <p class="posted"><a href="#commentNumber20">Comment</a> by

Monica LaCasse on 08/10  at  11:22 AM

<div id="commentNumber21" class="commentEntry">
<p>The heading of the article is misleading, this method of checkbox replacement is not accessible.

    <p class="posted"><a href="#commentNumber21">Comment</a> by

michael on 08/14  at  01:51 AM

<div id="commentNumber22" class="commentEntry">
<p>The code is really nice though - I think all it would need to become accessible is to move some of the css to be added by the plugin itself, that way if script is off the normal checkbox/radios just come up.

For anyone looking for a similar but accessible solution try

    <p class="posted"><a href="#commentNumber22">Comment</a> by

michael on 08/14  at  01:55 AM

<div id="commentNumber23" class="commentEntry fg">
<p>@michael: Could you explain a scenario where this widget is not accessible? It makes use of the native HTML input (check/radio) element, positioned out of view, so users on assistive technology actually interact with the input itself rather than other markup acting as a proxy to that input. It appears to be somewhat similar to the technique you linked to above, except we’re just toggling classes on the label element based on the state of the input itself (instead of using an extra span). As far as we can tell, this is completely accessible, and we’ve tested on a couple screen readers to make sure (but please let us know what you’ve found).

As mentioned in the comments above, one scenario where accessibility may be compromised would be for visual users who have images disabled, because the background images are necessary for the visual user experience. We have updated the script locally to fix this issue by positioning the input directly behind the image icon. That way if the image fails to load, the native input can be used in its place. When we get time, we’ll try to update this article with that revised script.

In general though, we’re curious where you think this widget may cause problems with accessibility, so please let us know! Thanks.

    <p class="posted"><a href="#commentNumber23">Comment</a> by

Scott (Filament) on 08/14  at  09:23 AM

<div id="commentNumber24" class="commentEntry">

Other than the situation you spoke off there is one more.
When javaScript is turned off the radio and checks are positioned off stage and your just left with some round and square boxes with no functionality. I like the updated method you speak of and although I have not seen this yet I think it may act the same when javascript is off.

A quick fix for the updated script could be.
Remove this from the css ‘.custom-radios label’ class
background: url(check-radio.gif) no-repeat 0 0;
at beginning of script
$(’.custom-radios label’).css({’background’ : ‘url(check-radio.gif) no-repeat 0 0’});

This way if javaScript is turned off the images wont even load and you’ll get normal check and radios that function.

What do you think?

    <p class="posted"><a href="#commentNumber24">Comment</a> by

michael on 08/18  at  07:26 PM

<div id="commentNumber25" class="commentEntry fg">
<p>@ michael: oh. That’s odd. Thank you for pointing out that the classes are in the markup at page load. These should definitely be added with JS so there’s a distinct difference in experience when JS is unavailable.

We’ll try to upload the new script as soon as we can!

    <p class="posted"><a href="#commentNumber25">Comment</a> by

Scott (Filament) on 08/19  at  08:55 AM

<div id="commentNumber26" class="commentEntry fg">
<p>Thanks again to everyone for the helpful feedback!&nbsp; We just posted an update to the plugin script and CSS that fixes a problem mentioned by Cezary Tomczyk—the widget as we had originally structured it failed when images weren’t present.&nbsp; So we re-factored the script to work whether or not images load. And, to Michael’s point, we also made sure that the classes to position the inputs are applied by the script, not written into the markup served with the page, so that they remain in place when JS isn’t available.&nbsp; Check out the updated article for details.

    <p class="posted"><a href="#commentNumber26">Comment</a> by

Maggie (Filament) on 08/19  at  03:23 PM

<div id="commentNumber27" class="commentEntry">
<p>Awesome this is now perfect by well… my standards. Thanks for taking the comments/suggestions on board, and posting an updated script.

    <p class="posted"><a href="#commentNumber27">Comment</a> by

michael on 08/19  at  06:47 PM

<div id="commentNumber28" class="commentEntry">
<p>when the checkbox is INSIDE the label, this script kills both :S

    <p class="posted"><a href="#commentNumber28">Comment</a> by

Luka Kladaric on 08/20  at  04:46 AM

<div id="commentNumber29" class="commentEntry fg">
<p>@Luka Kladaric:&nbsp; I can imagine a few cases where nesting inputs in labels would simplify the markup or a related script, but we avoid marking up forms that way for a few reasons:&nbsp;

* semantically it doesn’t make sense for an input to be a child of its label,
* the “for” attribute associates labels to their form fields, so nesting really isn’t necessary, and
* it’s easier to style them as separate elements

For these reasons we don’t plan on updating the script to work with nested input/label pairs, but feel free to update it to suit your project—it’s open source under the MIT and GPL licenses.

    <p class="posted"><a href="#commentNumber29">Comment</a> by

Maggie (Filament) on 08/20  at  09:12 AM

<div id="commentNumber30" class="commentEntry">
<p>for some reason, &lt;input type="checkbox" checked="” /&gt; will be detected as “checked” by your plugin.

Strictly speaking, it should be checked either as:

<input type="checkbox" name="vehicle" value="Car" checked="checked" />

<input type="checkbox" name="vehicle" value="Car" checked />

The following should not be checked:

<input type="checkbox" name="vehicle" value="Car" checked="” />

    <p class="posted"><a href="#commentNumber30">Comment</a> by

pixeline on 08/20  at  11:21 AM

<div id="commentNumber31" class="commentEntry">

What should I do to have the inputs horizontally aligned instead of vertically?

Thanks in advance

    <p class="posted"><a href="#commentNumber31">Comment</a> by

RS71 on 08/20  at  02:21 PM

<div id="commentNumber32" class="commentEntry">
<p>@Maggie: okay, thanks for the clear response.. I do think it should work, or at least skip and not mangle the mentioned case, but it’s still a great plugin as-is

    <p class="posted"><a href="#commentNumber32">Comment</a> by

Luka Kladaric on 08/20  at  04:16 PM

<div id="commentNumber33" class="commentEntry">
<p>@ luka.

The powers in your hands. Just apply a class to the elements that you either want or don’t want to have this functionality applied and update the script call accordingly.

@RS71 -
remove display:block; and add float:left; to the below class
“.custom-checkbox label, .custom-radio label”
I haven;t tested it but should be ok and get you started.

    <p class="posted"><a href="#commentNumber33">Comment</a> by

michael on 08/24  at  11:11 PM

<div id="commentNumber34" class="commentEntry fg">
<p>@pixeline:&nbsp; the behavior you’re seeing—where inputs with the checked attribute set to checked="” are showing up as checked—is actually standard browser behavior, it’s not the plugin.&nbsp; We agree that logically checked="” should register as unchecked, but apparently browsers only look for the presence of the attribute (we think this may be the case because it only accepts one value).&nbsp; It looks like the safest bet is to make sure there are no empty checked="” attributes in your code.

    <p class="posted"><a href="#commentNumber34">Comment</a> by

Maggie (Filament) on 08/28  at  10:15 AM

<div id="commentNumber35" class="commentEntry">
<p>First of all, thank you for the script. It’s small and flexible. I minimized the script and css, because I only need radio button. And made some changes. If anyone wants these. Here it is:


    <p class="posted"><a href="#commentNumber35">Comment</a> by

Sevil YILMAZ on 08/28  at  06:34 PM

<div id="commentNumber36" class="commentEntry">

Your script does not work in Internet Explorer 8, if the attribute name is array

<input type="checkbox" name="elementname[key1]" />
<input type="checkbox" name="elementname[key2]" />
<input type="checkbox" name="elementname[key3]" />
<input type="checkbox" name="elementname[key4]" />

Write about it in the documentation or fix the bug, so people do not suffer.

    <p class="posted"><a href="#commentNumber36">Comment</a> by

Anton Kulakov on 09/15  at  02:40 AM

<div id="commentNumber37" class="commentEntry fg">
<p>@Anton: If there is indeed a conflict with array-like name attribute values and this script, we welcome you to comment with a patch. Otherwise, when we have time, we will take a look and see if it’s something we can work around.

I understand that the practice of structuring name values in this manner is at least somewhat common among developers, but do you think the issue may have to do with IE8 itself and its conformance to the doctype you’re using? For example, the HTML 4 recommendation specifies which characters are allowed within a name attribute’s value, and that limited character set does not include square brackets. I’m not sure about other doctypes, but before we spend time on it, we’d appreciate if you could make sure the issue is actually a bug in our script, and not just the implementation in IE8 (however proper or quirky that may be).

And again, patches and constructive feedback are always appreciated.

    <p class="posted"><a href="#commentNumber37">Comment</a> by

Scott (Filament) on 09/15  at  09:15 AM

<div id="commentNumber38" class="commentEntry">
<p>Nice Job Guys. Excellent and works great in I.E 6 ;)

    <p class="posted"><a href="#commentNumber38">Comment</a> by

Trevor Saint on 10/19  at  06:00 AM

<div id="commentNumber39" class="commentEntry">
<p>Very Nice!! and just read in the Comments that it even works in IE6!! fantastic

    <p class="posted"><a href="#commentNumber39">Comment</a> by

Greg on 10/21  at  10:38 AM

<div id="commentNumber40" class="commentEntry">
<p>Impressive option for forms. Thanks for putting all of this together and sharing. Much appreciated.

    <p class="posted"><a href="#commentNumber40">Comment</a> by

Jon Livingston on 10/21  at  10:42 AM

<div id="commentNumber41" class="commentEntry">
<p>Nice script.

One thing I did notice is that the the skinned inputs don’t reflect any changes made to the values of the input fields using JavaScript.

Simple use case, I may have a form containing two radio options - “Schedule a Payment” or “Pay Now”. One of these options has an additional field associated with it where the user can enter a date or something.

If a user clicks the date field and inputs something, I want to auto-select the appropriate radio button for the user.  With this script applied, this is not reflected to the user.

Perhaps a listener on the state of original input would be a good idea?

    <p class="posted"><a href="#commentNumber41">Comment</a> by

Chris on 10/21  at  01:05 PM

<div id="commentNumber42" class="commentEntry">
<p>Adding this additional Event listener seems to solve my problem:

if (’:checked’)) {
if (’:radio’)) {
else { label.removeClass(’checked checkedHover checkedFocus’); }

Of course, when changing elements via JavaScript, you need to remember to trigger the change event.

    <p class="posted"><a href="#commentNumber42">Comment</a> by

Chris on 10/21  at  01:18 PM

<div id="commentNumber43" class="commentEntry">
<p>Wow, this is one of those techniques which are clearly, radiantly, fantastically useful. Thank you for the write-up.

    <p class="posted"><a href="#commentNumber43">Comment</a> by

Jeremy Carlson on 10/22  at  10:46 AM

<div id="commentNumber44" class="commentEntry">
<p>FAIL - Come on guys, I tried to tab through the page, and it got it wrong on the radio buttons. It tabs straight to the selected button and then off the form. How has this been tested for accessibility?

    <p class="posted"><a href="#commentNumber44">Comment</a> by

terry t on 10/22  at  04:39 PM

<div id="commentNumber45" class="commentEntry fg">
<p>@terry t:&nbsp; It seems you have a problem with native form behavior, as we didn’t do anything but style the checkboxes and radios; both sets of inputs rely on their native keyboard functionality.&nbsp; In Firefox, for example, you can tab between checkboxes because each one accepts a value, but you can only tab *to* a set of radio buttons because the entire set only accepts a single value.&nbsp; To make a radio button selection, you have to use the arrow keys after you’ve tabbed into the set.&nbsp; Try turning off JavaScript and you’ll see that our example page works the same way whether the inputs are enhanced with styles or not.

    <p class="posted"><a href="#commentNumber45">Comment</a> by

Maggie (Filament) on 10/22  at  04:55 PM

<div id="commentNumber46" class="commentEntry">
<p>Beautiful work guys.

Odd behaviour though in IE7: the page is long and has a lot of checkboxes. Clicking on the last one brings the focus on top page, scrolling abruptly upwards in one shot.
Doesnt do so if I disable the .custom-radio input attributes in the CSS (I believe absolute positioning could be the problem).

    <p class="posted"><a href="#commentNumber46">Comment</a> by

Manaus on 10/23  at  07:03 AM

<div id="commentNumber47" class="commentEntry">

I have been having the same problem, haven’t had a chance to look at the javascript to see why its doing that if something isn’t posted up sooner than i figure something out ill post a response!

    <p class="posted"><a href="#commentNumber47">Comment</a> by

Matt on 10/30  at  01:11 PM

<div id="commentNumber48" class="commentEntry">
<p>Follow up i fixed the IE 7 bug for me by removing position: absolute; from .custom-checkbox input, .custom-radio input, and adding left: -20px to custom-checkbox label, .custom-radio label. This seems to have solved the issue for me.

    <p class="posted"><a href="#commentNumber48">Comment</a> by

Matt on 10/30  at  01:20 PM

<div id="commentNumber49" class="commentEntry">
<p>Nice Job, Nice script ----   But…   It doesn’t play well with others......&nbsp;   Incorporating this into pages using slideToggle  produces less than desirable results in IE 6,7,8.

Specifically, this is more of a slideToggle issue with nested elements using position: absolute etc....  But it makes this wonderful tool - useless

    <p class="posted"><a href="#commentNumber49">Comment</a> by

Kevin on 11/19  at  10:04 AM

<div id="commentNumber50" class="commentEntry">
<p>Great script! I do have 1 question regarding the radio button styles. Is it possible to have each of the radio buttons have a different style? For example: 1st Radio has a Green Check and the 2nd Radio has a Blue Check?

    <p class="posted"><a href="#commentNumber50">Comment</a> by

Stephen on 12/17  at  12:05 PM

<div id="commentNumber51" class="commentEntry fg">
<p>@Stephen: sure, you can apply whatever classes you’d like to the labels to style them as you need.

    <p class="posted"><a href="#commentNumber51">Comment</a> by

Scott (Filament) on 12/17  at  12:10 PM

<div id="commentNumber52" class="commentEntry">
<p>@Scott Thanks for the prompt response. I want to use 2 different background images for the .custom-radio label style. Without making a large amount of changes to your jQuery code I don’t see this being possible. Am I missing something here? Thanks!

    <p class="posted"><a href="#commentNumber52">Comment</a> by

Stephen on 12/17  at  02:35 PM

<div id="commentNumber53" class="commentEntry">
<p>@Scott figured it out, thanks!

    <p class="posted"><a href="#commentNumber53">Comment</a> by

Stephen on 12/17  at  03:58 PM

<div id="commentNumber54" class="commentEntry">

    <p class="posted"><a href="#commentNumber54">Comment</a> by

yyj on 12/29  at  09:25 PM

<div id="commentNumber55" class="commentEntry">
<p>just a small bug report… line 63 should be:


    <p class="posted"><a href="#commentNumber55">Comment</a> by

Joshua Jabbour on 01/10  at  02:15 PM

<div id="commentNumber56" class="commentEntry">
<p>I came across this after trying to solve a problem with my own similar solution. In my HTML, the text of the label is hidden so the user toggles the checkbox by clicking the “image” (really the label with a background image). The label contains a span that is hidden if images are on.

This works dandy in Safari, Chrome, etc., but in Firefox, clicking again after the first click highlights the text of the label rather than toggles the checkbox. Obviously, this makes my label-less button pretty much unusable in Firefox.

I noticed this is happening in your demo (I also replaced my script with yours to see if there was something I’d missed - same issue) as well. I feel like I solved this recently - the Firefox-selecting behavior - but can’t for the life of me remember how. Any thoughts?

    <p class="posted"><a href="#commentNumber56">Comment</a> by

Jennie on 01/11  at  08:44 PM

<div id="commentNumber57" class="commentEntry">
<p>Great job, thanks for this code.

In your example in IE form legend tag has its default color - blue. It seems that IE needs extra color declaration. In Firefox legend color is inherited.

    <p class="posted"><a href="#commentNumber57">Comment</a> by

Krystian on 02/10  at  12:20 PM

<div id="commentNumber58" class="commentEntry">
<p>thanks for this script. I found a problem though when radio fields have names like radio[id]. Fixed it enclosing line 26 with double quotes:

var allInputs = $(’input[name="’+input.attr(’name’)+‘“]’);

    <p class="posted"><a href="#commentNumber58">Comment</a> by

rachel on 02/15  at  06:19 AM

<div id="commentNumber59" class="commentEntry">
<p>I’d like to rebut your statement, “Styling checkbox and radio button inputs to match a custom design is nearly impossible...”

I have come up with a pure CSS solution for styling radio and checkboxes,

    <p class="posted"><a href="#commentNumber59">Comment</a> by

Ryan Seddon on 02/19  at  01:45 AM

<div id="commentNumber60" class="commentEntry fg">
<p>@Ryan: Thanks, that’s an interesting technique, and it’s similar to ours in that you’ve found a workaround to avoid styling the actual inputs (though yours doesn’t use any JS, which is nice). We usually aim to figure out a solution that works across all the common browsers. The CSS selectors you’re using won’t work in any versions of Internet Explorer, will they?

    <p class="posted"><a href="#commentNumber60">Comment</a> by

Scott (Filament) on 02/19  at  08:14 AM

<div id="commentNumber61" class="commentEntry">
<p>Why is this no widget in jquery ui? I think, styling forms and make them look the same in all browsers is the most common wish for all developers.

    <p class="posted"><a href="#commentNumber61">Comment</a> by

Oliver on 03/09  at  06:15 AM

<div id="commentNumber62" class="commentEntry">
<p>Your work, is it the base of jquery ui checkbox,radiobutton widget ?

    <p class="posted"><a href="#commentNumber62">Comment</a> by

blr on 04/04  at  06:25 PM

<div id="commentNumber63" class="commentEntry">
<p>Great approach and such simpicity!!!

I need some help. I want to be able to use a sprite to display a different image for each radio button. So I added a class to each label such as “xs”, “s” and “m”. Then I added
this for each class:
.custom-radio LABEL.xs {
.custom-radio LABEL.xs.hover {
.custom-radio LABEL.xs.focus {
.custom-radio LABEL.xs.checked {
and it works in Safari 4 and Firefox 3.6.3 but guess what: not in IE8

I posted the sample here:

Thanks in advance

    <p class="posted"><a href="#commentNumber63">Comment</a> by

Michael on 04/13  at  01:10 AM

<div id="commentNumber64" class="commentEntry">

I didn’t specify the error in the above post. On hover over “xs” or"s" the incorrect sprite “m” is displayed but only in IE. I’m just clueless as to how to fix this!

    <p class="posted"><a href="#commentNumber64">Comment</a> by

Michael on 04/13  at  01:17 AM

<div id="commentNumber65" class="commentEntry">
<p>Any chance you can post up a .psd of the sprite you’re using for the checkboxes and radio buttons?&nbsp; Would be awesome to change the green color to another color that might be in a project’s palette.

    <p class="posted"><a href="#commentNumber65">Comment</a> by

cancel bubble on 04/14  at  01:42 PM

<div id="commentNumber66" class="commentEntry">
<p>Can you please post sample example using above features/functionality ?

    <p class="posted"><a href="#commentNumber66">Comment</a> by

Chital on 05/11  at  08:09 AM

<div id="commentNumber67" class="commentEntry">

very pretty script you wrote, thank you !
I have one question : in my project, I have to display dialog boxes (formerly with jQuery.dialog(), now with nyroModal plugin), HTML content of these dialogs is generated by javascript. And in these dialogs, customInput isn’t called… (in the others parts of the website, customInput works perfectly)
Does anyone have an idea ? Do I have to call again customInput in every dialog I create or is there another, more elegant, solution?

    <p class="posted"><a href="#commentNumber67">Comment</a> by

AkaiKen on 06/18  at  03:58 AM

<div id="commentNumber68" class="commentEntry">
<p>This was a great help, thanks for putting it out.

    <p class="posted"><a href="#commentNumber68">Comment</a> by

Bill on 07/07  at  04:31 PM

<div id="commentNumber69" class="commentEntry">
<p>An issue arised while I placed checkboxes and radio buttons within dialog boxes. The appearance is fine but I am not able to select the check box. As I have found a small surface on the top left is working and makes selection. It doesn’t work properly. I couldn’t figure it out what’s wrong with it. I appreciate your help.

    <p class="posted"><a href="#commentNumber69">Comment</a> by

Alipix on 07/20  at  02:07 AM

<div id="commentNumber70" class="commentEntry">
<p>Excellent script. Love this version. Will get my head into it in more detail and use for future projects.

Top effort chaps.

Thank you.

Trevor Saint

    <p class="posted"><a href="#commentNumber70">Comment</a> by

Trevor Saint on 07/20  at  06:12 AM

<div id="commentNumber71" class="commentEntry">
<p>Thank you for this nice plugin,

is it possible to have a status for disabled checkbox and radio boxes??
Thank you

    <p class="posted"><a href="#commentNumber71">Comment</a> by

Reda on 07/21  at  02:42 PM

<div id="commentNumber72" class="commentEntry">
<p>When you uncheck checkbox a focus class is still on this element, no matter a cursor is or isn’t above this checkbox. To solve this problem I’ve made a small modification:

if(inputType == ‘checkbox’ &&’:checked’)){
function(){ $(this).removeClass(’hover checkedHover focus’); }

I remove focus class when cursor is out of checkbox.

I hope this help;)

    <p class="posted"><a href="#commentNumber72">Comment</a> by

luke on 08/12  at  03:32 AM

<div id="commentNumber73" class="commentEntry fg">
<p>@ Reda: We’ll be sure to include disabled state management when we release the rewritten version of this plugin from our book. Look for that update sometime soon!

@Luke:  The focus class should be present when the input is actually focused, which is a different state entirely than a mouse hover. We wouldn’t recommend removing the focus class on mouseout, as the states are largely unrelated. If you’re navigating the page with a keyboard, an input will retain its focus while checking and unchecking it. When possible, we prefer to match that native behavior to match user expectations.

    <p class="posted"><a href="#commentNumber73">Comment</a> by

Scott (Filament) on 08/12  at  11:36 AM

<div id="commentNumber74" class="commentEntry">
<p>Thank you, looking forward to it ;)

    <p class="posted"><a href="#commentNumber74">Comment</a> by

reda on 08/12  at  11:44 AM

<div id="commentNumber75" class="commentEntry">
<p>@Scott: Thank you for answer. I have to admit that you are right. I had a more complex form where states of one element depends on states of others and for a moment a thought modification that I made was a solution, but I was wrong. Still I got a really bad mess with states on radio buttons and checkboxes.

Now I’ve made some changes in my scripts to modify form element classes rather than modify plug-in itself and its works much better.

Thank you for sharing this plug-in.

    <p class="posted"><a href="#commentNumber75">Comment</a> by

luke on 08/13  at  03:40 AM

<div id="commentNumber76" class="commentEntry">

I think there are some elements missing in the script pasted above on this page:

// wrap the input + label in a div
‘).insertBefore(input).append(input, label);

looks like it is missing the div generation. It seems to be okay on the example pages, apologies if that was pointed out in the text and I inadvertently skipped over it.

    <p class="posted"><a href="#commentNumber76">Comment</a> by

Tim on 08/20  at  07:07 PM

<div id="commentNumber77" class="commentEntry">
<p>Any plans to make this work with Themeroller?

We’re doing everyhting in our app with jquery ui themes, and having to make a couple of extra gifs for each theme to match can turn into alot of photoshop drudgery :P


    <p class="posted"><a href="#commentNumber77">Comment</a> by

Charles on 09/01  at  02:44 PM

<div id="commentNumber78" class="commentEntry">
<p>Any idea about the next rewritten version release date??


    <p class="posted"><a href="#commentNumber78">Comment</a> by

Reda on 09/03  at  09:26 PM

<div id="commentNumber79" class="commentEntry">
<p>Hi, at first: I love this script!

Unfortunately I have a problem, not knowing how to solve it:
I use only the radiobuttons. There’s a list with about 100 persons and for each person 10 different states of the radio can be chosen. No problem for FF, but in IE7 (IE8 I don’t know yet) theres an alert questioning me, if I want to go on, because a script is slowing down the proceeding. Telling this alert twice (or some more times) to go on, finally all is presented well and works fine. Does somebody has an idea to solve this problem of performance? Thanks in advance!

    <p class="posted"><a href="#commentNumber79">Comment</a> by

elke on 09/13  at  11:07 AM

<div id="commentNumber80" class="commentEntry">
<p>I added reset button, but its not working for me.

need help pls

    <p class="posted"><a href="#commentNumber80">Comment</a> by

sanjiv on 09/22  at  12:22 PM

<div id="commentNumber81" class="commentEntry">
<p>@reda: I also needed the disabled state, and I made some tweaks to support it. You can find them here: <a href="" rel="nofollow"></a>. Feel free to check and see if it works for you.

    <p class="posted"><a href="#commentNumber81">Comment</a> by

Craig Oshima on 09/22  at  04:28 PM

<div id="commentNumber82" class="commentEntry">
<p>@Craig Oshima: thank you so much ;) i’ll use it very soon. didn’t have the courage to modify the code…

I’d like to ask a question that has nothing to do with this plugin, i just didn’t find the answer in any forums…
i’m creating a website that has a login popup exactly like in and am using Ajax ($.post)
the probleme is that the page isn’t in https, that means the user is entering his email and password in an unsecured page. do you have a solution for that?
i found this plugin if it interests anyone but is it as reliable as ans SSL certificate?
Thank you so much for your help

    <p class="posted"><a href="#commentNumber82">Comment</a> by

Reda on 09/22  at  05:33 PM

<div id="commentNumber83" class="commentEntry">

I want to give check all functionality to your script. But it is not working. I have set all checkboxes checked using their respective ids.

<input type=’checkbox’ id=’c1’ name=’c1’>
<input type=’checkbox’ id=’c2’ name=’c2’>

function checkAll()


    <p class="posted"><a href="#commentNumber83">Comment</a> by

computerzworld on 10/01  at  02:05 AM

<div id="commentNumber84" class="commentEntry">
<p>Continuing with my previous comment…


And I am calling this function on click of link. But checkboxes are not getting checked. Has anybody implemented this functionality? If yes then please share your reviews over here. Thanks..

    <p class="posted"><a href="#commentNumber84">Comment</a> by

computerzworld on 10/01  at  02:08 AM

<div id="commentNumber85" class="commentEntry">
<p>Nice script but I’m having a heck of a time trying to get two different lists of radio buttons to style differently on the same page in IE6. It works fine in every other browser but in IE6 the first set of radio buttons is picking up the hover, focus and checked states of the second set even though they have very distinct classes. There’s also a checkbox further down on the same form picking up the same style as the last set of radio buttons even though I haven’t included a custom-checkbox class anywhere in the CSS. It’s driving me nuts.

    <p class="posted"><a href="#commentNumber85">Comment</a> by

Brad Shaw on 10/14  at  11:40 PM

<div id="commentNumber86" class="commentEntry">
<p>@computerzworld: you can’t just set the checked property to true as you’ve discovered. You must also trigger the custom event updateState to update the display. The same goes for setting disabled state. I actually added a function to do take care of this:

jQuery.fn.checked = function(bool) {

// If no bool param, return value of first checkbox or radio
if (typeof bool == “undefined") {
if (this.length > 0) {
return !!this[0].checked;
return false;
// Otherwise set the checked attribute accordingly
else {
return this.each(function(i) {
var $this = $(this);
if ($"input:checkbox,input:radio")) {
this.checked = bool;

FWIW, I’m probably going to end up swapping this out with the checkbox/radio that jQuery UI is working on, because I’m finding this solution a bit limited when you have various non-white or patterned backgrounds.

    <p class="posted"><a href="#commentNumber86">Comment</a> by

Craig Oshima on 10/15  at  09:50 AM

<div id="commentNumber87" class="commentEntry">
<p>Oh, you would use the above like:

$("#c1").checked(); // returns true

@Brad Shaw:
I have the good fortune of being able to not worry about IE6 anymore. :-)

    <p class="posted"><a href="#commentNumber87">Comment</a> by

Craig Oshima on 10/15  at  09:55 AM

<div id="commentNumber88" class="commentEntry">

Yeah, unfortunately IE6 still makes up close to 20% of our visitors so I haven’t got much choice in the matter. It’s got to work in that POS browser as well. It’s sad that IE is holding up the Internet, and soon people will be using 4 versions each with it’s own issues. Makes me want to cry.

Can you give me a more fleshed out example of how to make this script work with two distinct classes of radio buttons? In my case I have flags with $, £ and € symbols at the top for selecting currency and then big fat check boxes (radio buttons in disguise) in a list to select a product package.


    <p class="posted"><a href="#commentNumber88">Comment</a> by

Brad Shaw on 10/15  at  10:55 AM

<div id="commentNumber89" class="commentEntry">
<p>@Brad Shaw: Wouldn’t this be exactly the time when you’d explain to your client that styling checkboxes is an enhancement that only works in modern browsers? Obviously you want the users to like the site, but IE6 users are not going to be seeing much in the way of sexy styled checkboxes anywhere else either. They don’t see the internet that you see, nor, I might suggest, is it important that they do. What’s important is that the site works for them. Their experience, at 20% market share, is certainly important. But identical? I would suggest not.

Just my $.02. I don’t plan to abandon IE6 to the wolves anytime soon, but I don’t think bending over backwards for it makes sense for anyone - the developer, the client, or the user.

    <p class="posted"><a href="#commentNumber89">Comment</a> by

Jeremy Carlson on 10/15  at  12:20 PM

<div id="commentNumber90" class="commentEntry">
<p>@Jeremy: While I can appreciate the sentiments (I’m all for killing of IE6 ASAP), I’m pretty sure this is quite doable in IE6, I just need to figure out how to make it work. The single style demo here on works perfectly fine. What I am doing nearly works, I’m just missing something.

I have to disagree that it’s not important for IE6 users to receive the same web browsing experience wherever possible especially when talking about ecommerce sites and sales conversions. I can’t just disregard 20% of my customer base and relegate them to a inferior experience because of my disgust for IE6. Doing so could mean a very significant difference to my bottom line.

This isn’t bending over backwards, it’s just me not understanding how to get two custom classes working properly with this script, and I would appreciate a little help.

    <p class="posted"><a href="#commentNumber90">Comment</a> by

Brad Shaw on 10/15  at  12:42 PM

<div id="commentNumber91" class="commentEntry">
<p>@Brad Shaw - I hear ya :) Do you have a sample to look at? I’m sure Craig’s your man here, but I’ve gotten curious ...

    <p class="posted"><a href="#commentNumber91">Comment</a> by

Jeremy Carlson on 10/15  at  12:53 PM

<div id="commentNumber92" class="commentEntry">
<p>I’m fairly certain the problem is that IE6 is choking on my CSS. When I modified the Filament Group plugin, I made a number of modifications (described on my sample page); I didn’t *just* add the disabled state. One of those changes was to eliminate the original plugin’s “checkedHover” and “checkedFocus” CSS classes. Technically, they were unnecessary, and it allowed reducing the amount of code. That’s great for me, but it’s probably what breaks IE6. I see that Filament’s sample works fine, but even my basic sample is a bit wonky on IE6. When I get a chance, I’ll see if backing out that change fixes things. No promises just seems the most likely issue.

    <p class="posted"><a href="#commentNumber92">Comment</a> by

Craig Oshima on 10/15  at  02:02 PM

<div id="commentNumber93" class="commentEntry">
<p>Hey. The test page is here… <a href="" rel="nofollow"></a> and the page is buy-ion-extra.php to see the order form. Don’t want a live link to it from here. It’s meant to replace our live ordering form which isn’t so hot in comparison.

As you can see it’s working nicely in all other browsers other than IE6. Tested in FF, Chrome, Safari, IE7 & 8… there are a couple small cosmetic issues in Opera but it’s working right for the most part. Had CSS3 PIE installed for the rounded corners but it’s more trouble than it’s worth I think.

Anyways, if you’ve got any feedback whatsoever let’s hear it! Thank you.

    <p class="posted"><a href="#commentNumber93">Comment</a> by

Brad Shaw on 10/15  at  03:04 PM

<div id="commentNumber94" class="commentEntry">
<p>’re still using the original Filament Group plugin, so it definitely doesn’t have anything to do with any changes I made with my version of their plugin. I remember that IE6 had lots of issues with shifting background images, so that’s where I’d start looking.

(And I know I’ll be called a heretic, but since 20% of your audience warrants the extra effort, I’d consider building a custom solution that works for IE6 and not bother with trying to find a single solution that works for IE6 *and* more modern browsers. I think it would be quicker and easier to support two versions of this page than to 1) tear your hair out figuring out IE6’s woes and 2) polluting your main branch with hacks to get it working with a 10-year old browser that will only get less common over time. In its day IE6 was great, and you can easily implement this page & functionality for IE6...just not with modern code. Just my opinion, but I’m just not into that agony...I mean, challenge :-)

    <p class="posted"><a href="#commentNumber94">Comment</a> by

Craig Oshima on 10/15  at  05:38 PM

<div id="commentNumber95" class="commentEntry">
<p>OK, thanks for the feedback. I’ve figured out what the problem is.

The code would write a custom class with a hover state for a radio button like this:

<label for="usd" class="usd hover">USD</label>

A custom class with a hover state for a radio button that might come later in the form might look like this:

<label for="product-1" class="product hover">Product 1</label>

With the “hover” class overriding the custom CSS of the previous one. What I would like to do is have the class amended on hover without the space between the two therefore becoming a unique identifier. Then I would write the CSS rule like:

.custom-radio label.producthover

instead of

.custom-radio label.product.hover

How could I modify the script to do this?

    <p class="posted"><a href="#commentNumber95">Comment</a> by

Brad Shaw on 10/16  at  05:45 PM

<div id="commentNumber96" class="commentEntry">
<p>Basically addClass adds a space to the already existing class when adding the new one. Is there some way to make it amend the class on rollover without adding that space?

    <p class="posted"><a href="#commentNumber96">Comment</a> by

Brad Shaw on 10/16  at  07:37 PM

<div id="commentNumber97" class="commentEntry">
<p>Yes and no. Yes, it’s possible to update the class to be “producthover”, but you must explicitly say addClass("producthover"). You can’t have &lt;label class="product"&gt; and expect addClass("hover") to make the class be “producthover”. Each class is distinct, and spaces is how they’re separated. In the original plugin’s code, you’ll see addClass("checkedHover") and removeClass("checkedHover"), so I’d look at that if you think this is the best solution. HOWEVER, for your case, I think it might be better to revisit the markup and CSS. You have 2 types of radios...instead of making them different by assigning classes (like “product") to the radio elements themselves, put the class on their containers. Then you can scope your CSS selectors accordingly, like:

.products .custom-radio label.hover {...}
.currency .custom-radio label.hover {...}

Just a thought…

    <p class="posted"><a href="#commentNumber97">Comment</a> by

Craig Oshima on 10/16  at  11:50 PM

<div id="commentNumber98" class="commentEntry">
<p>The problem with the latter solution is that it would require a bunch more divs. Each currency button would be required to be wrapped in a div, which is in turn wrapped in a div by the script. Same with the product selection since there are 4 different classes of radio buttons in that.

I might modify the wrapper div that the script creates to enclose each input/label pairing in a variety of different ways but I don’t know how to do that.

    <p class="posted"><a href="#commentNumber98">Comment</a> by

Brad Shaw on 10/17  at  10:10 AM

<div id="commentNumber99" class="commentEntry">
<p>Loving this solution…

That said.... (first praise, then criticism ;))
It looks like this has a usability-problem when used in a form with a reset-button…

Anybody (besides Sanjiv ;)) encountered this, and even better has found a solution/workaround for this?

    <p class="posted"><a href="#commentNumber99">Comment</a> by

ReLexEd on 10/20  at  01:34 PM

<div id="commentNumber100" class="commentEntry">
<p>Almost certainly that problem is related to the fact that the custom “updateState” event is not triggered. To fix that, you’d want to trigger that event on all custom checkboxes/radios when the form is reset. (Personally, I rarely find Reset to be a useful function for users...hey! Advice, then criticism? ;-) )

    <p class="posted"><a href="#commentNumber100">Comment</a> by

Craig Oshima on 10/20  at  03:47 PM

<div id="commentNumber101" class="commentEntry">
<p>Been looking for a way to way to create a simple voting form, using radio buttons and replace them with some images that are a little more palatable to look at should be perfect. Thanks for creating this.

    <p class="posted"><a href="#commentNumber101">Comment</a> by

Tyler Herman on 10/25  at  05:28 PM

<div id="commentNumber102" class="commentEntry">
<p>Hey .

What should I do to have the inputs horizontally aligned instead of vertically? .
Thanks in advance

    <p class="posted"><a href="#commentNumber102">Comment</a> by

basur on 11/02  at  04:03 AM

<div id="commentNumber103" class="commentEntry">
<p>I’m fairly certain the problem is that IE6 is choking on my CSS. When I modified the Filament Group plugin, I made a number of modifications (described on my sample page); I didn’t *just* add the disabled state.

    <p class="posted"><a href="#commentNumber103">Comment</a> by

sigara bırakma on 12/01  at  06:05 AM

<div id="commentNumber104" class="commentEntry">

What about RTL e.g. <html dir="rtl">?

    <p class="posted"><a href="#commentNumber104">Comment</a> by

NajiCo on 12/03  at  01:02 AM

<div id="commentNumber105" class="commentEntry">

It’s not working with RTL e.g. <html dir="rtl"> or when we use a panel with RightToLeft Horizontal alignment? Hope you can help in this issue.
Thankx in advanced.

    <p class="posted"><a href="#commentNumber105">Comment</a> by

Najico on 12/03  at  11:32 PM

<div id="commentNumber106" class="commentEntry">

the plugin doesnt’ work with inputs having array (brackets) in the name attribute.

To fix this problem, I made some changes in the code:
I replaced
var allInputs = $(’input[name=’+input.attr(’name’)+’]’);

with this code:
var allInputs = $(’input[name="’+input.attr(’name’)+‘“]’);

by doing this, the name variable will not fail if the jQuery attribute contains array.
Hope, it can help.
Mike Plavonil

    <p class="posted"><a href="#commentNumber106">Comment</a> by

MikePlavo on 12/13  at  10:12 AM

<div id="commentNumber107" class="commentEntry">
<p>Awesome plugin.

@MikePlavo:  thanks you for this tips.  It prevented me from a lot of headaches

    <p class="posted"><a href="#commentNumber107">Comment</a> by

Ethan on 12/15  at  04:45 PM

<div id="commentNumber108" class="commentEntry">
<p>Hi, where is the images for checkbox and radio?

    <p class="posted"><a href="#commentNumber108">Comment</a> by

Mik on 01/24  at  10:56 AM

<div id="commentNumber109" class="commentEntry">
<p>I was wondering if this script cancel the action onclick on the input

I used another script that does the same thing and it canceled the onClick action ive put on my input :(

Exemple: <input type="checkbox" name="checkbox" onClick="location.href=\’?fct=approuve&filename;=’.urlencode($file).’\‘“ />

    <p class="posted"><a href="#commentNumber109">Comment</a> by

Vincent Talbot on 01/25  at  01:12 PM

<div id="commentNumber110" class="commentEntry">

Proper code for previous comment on disabled checkboxes

if(input.attr(’disabled’)) {
$(this).css({cursor: ‘default’});
} else {
if(inputType == ‘checkbox’ &&’:checked’)){
function(){ $(this).removeClass(’hover checkedHover’); }

    <p class="posted"><a href="#commentNumber110">Comment</a> by

Dave on 02/10  at  11:14 PM

<div id="commentNumber111" class="commentEntry">
<p>Using Chrome on Windows 7, when clicking on a checkbox, the keyboard focus is not set to that selected checkbox. Thus, when pressing TAB, the keyboard focus starts with the first element on the window, not with the next following element after the previously selected checkbox.

The keyboard focus seems to work in IE and Firefox. In these browsers, if you have 5 checkboxes, click on checkbox 3, then press TAB, the next selected element in the window is checkbox 4. On Chrome it is checkbox 1.

    <p class="posted"><a href="#commentNumber111">Comment</a> by

Rudolf Bargholz on 02/24  at  01:27 AM

<div id="commentNumber112" class="commentEntry">
<p>When is this going to make it’s way in to the jQuery UI?

    <p class="posted"><a href="#commentNumber112">Comment</a> by

Nathan on 02/25  at  02:46 AM

<div id="commentNumber113" class="commentEntry">
<p>Great Tutorial but i having problems with IE 7, and i can’t figure out the reason because i did everything exactly like in the tutorial.

look at yhe bug: (if you don’t have IE 7 switch to compatibilty mode in IE8).

    <p class="posted"><a href="#commentNumber113">Comment</a> by

tod.radioz on 03/09  at  08:07 AM

<div id="commentNumber114" class="commentEntry">
<p>Why doesn’t it keep states? When I check a radio or checkbox and reload the page it doesn’t remember the states. Everything is unchecked on reload (F5). It works in FF 3.6.15 but not Chrome 10, IE8, Safari 5.0.4 (PC) and others. This is true in your demo (<a href="" rel="nofollow"></a>) as well.

    <p class="posted"><a href="#commentNumber114">Comment</a> by

Jens Hedqvist on 03/15  at  08:03 AM

<div id="commentNumber115" class="commentEntry">
<p>I’ve found it. When the DOM is altered (the custom input and label is wrapped in a div.custom-checkbox) Firefox gets confused and is unable to track states. For me, the states are “carved in stone in opposite”. If I check an unchecked checkbox it becomes checked for ever, regardles of reload. The same is true if I uncheck a checked checkbox.

It works like a charm if I wrap the elements in a div.custom-checkbox on page load. But that’s no good.

    <p class="posted"><a href="#commentNumber115">Comment</a> by

Jens Hedqvist on 03/15  at  08:43 AM

<div id="commentNumber116" class="commentEntry">
<p>I fixed the horizontal alignment issue.&nbsp; This simple change will align all the boxes or buttons in a horizontal row.&nbsp; Just add a float left to the container but do NOT remove the position relative.

/* wrapper divs */
.custom-checkbox, .custom-radio { float:left; position: relative; }

Then adjust all the various margins & paddings to your liking.

    <p class="posted"><a href="#commentNumber116">Comment</a> by

John on 03/17  at  09:24 PM

<div id="commentNumber117" class="commentEntry">
<p>I had some problems with this plugin using arrays as input names after upgrading the jQuery and jQueryUI to the latest versions (1.5.1 and 1.8.11). Firebug reported the error:

uncaught exception: Syntax error, unrecognized expression: [name=section[1]]

I solved the error by changing
var allInputs = $(’input[name=’+input.attr(’name’)+’]’);
around line 26 to
var allInputs = $("input[name=’"+input.attr(’name’)+"’]");

It worked fine using previous versions, but somehow something in the jquery updates messed things up. I hope this can help somebody else having the same problem…

    <p class="posted"><a href="#commentNumber117">Comment</a> by

Sebastian on 03/23  at  11:45 AM

<div id="commentNumber118" class="commentEntry">
<p>“I solved the error by changing

var allInputs = $(’input[name=’+input.attr(’name’)+’]’);
around line 26 to
var allInputs = $("input[name=’"+input.attr(’name’)+"’]"); “

I had the same exact issue- solved the same way.  It also happens with 1.6 RC1

    <p class="posted"><a href="#commentNumber118">Comment</a> by

NgM on 04/29  at  04:18 PM

<div id="commentNumber119" class="commentEntry">
<p>Nice sript but how do you uncheck it in jquery?

    <p class="posted"><a href="#commentNumber119">Comment</a> by

fritz on 05/02  at  10:06 AM

<div id="commentNumber120" class="commentEntry">
<p>Just removing the “checked” attribute doesn’t change the class so you have use this.


It works in Firefox 4 and IE 8.

    <p class="posted"><a href="#commentNumber120">Comment</a> by

fritz on 05/03  at  03:12 AM

<div id="commentNumber121" class="commentEntry">
<p>the fix for line 26 works great. I’m surprised you don’t update the script linked from this page…

    <p class="posted"><a href="#commentNumber121">Comment</a> by

myq on 05/03  at  06:26 AM

<div id="commentNumber122" class="commentEntry">
<p>Great - it works well on dev. Will try it on a live site and see how it performs!

    <p class="posted"><a href="#commentNumber122">Comment</a> by

Chris on 06/04  at  03:43 AM

<div id="commentNumber123" class="commentEntry">
<p>Perhaps someone might be able to assist me. I’ve spent the last four hours just trying to get this to work locally (it works fine on this website) but for the life of me cannot figure out why it won’t locally. I’ve copied and stored all required files (both .js and .css) but every time I go to view the page, it just shows the default checkboxes and radio buttons. Is there an additional file somewhere that I’m missing? Help.

    <p class="posted"><a href="#commentNumber123">Comment</a> by

Cole on 06/14  at  05:09 PM

<div id="commentNumber124" class="commentEntry">
<p>Ok, I’m an idiot. my CSS URL path was incorrect. Please igrore the previous post. :{

    <p class="posted"><a href="#commentNumber124">Comment</a> by

Cole on 06/14  at  05:43 PM

<div id="commentNumber125" class="commentEntry">
<p>There was a post sometime ago by Alipix mentioning that these inputs do not work within a dialog box.&nbsp; I had the same problem and solved it by changing the z-index for the custom labels and inputs.&nbsp; By default the jquery ui dialog has a z-index set to 1000, which puts the dialog on top of these inputs and prevents the click event from working properly on them.&nbsp; Setting the z-index of your custom inputs and labels to something like 2000 and 2001 respectively should fix it.

    <p class="posted"><a href="#commentNumber125">Comment</a> by

MrChris on 06/17  at  06:05 PM

<div id="commentNumber126" class="commentEntry">
<p>The best way to customize checkbox and make it compatible with ie6 :

Simple ZIP demo to download and videotutorial (in italian).

    <p class="posted"><a href="#commentNumber126">Comment</a> by

Marco Marcoaldi on 06/23  at  09:43 AM