Opened 12 years ago
Closed 12 years ago
#7072 closed bug (notabug)
jQuery-UI : buttonset() : When "checked" status of radio buttons change, their accompanying LABELs do not reflect this change in design.
Reported by: | shehriyari | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.0 |
Component: | ui.button | Version: | 1.8.9 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I am posting in step-by-step fashion:
a) In a form, I have radio buttons, two of them, upon which I applied UI's buttonset(): Copy code
- $("span.that_contains_my_radio_buttons").buttonset();
They look cool and when I click, they work just fine.
b) However, if I change "checked" status of those radio buttons in any of the following methods: Copy code
- $(".radio").removeAttr("checked");
- $(".radio").attr("checked","checked");
- $(".radio").get(0).checked = true;
- $(".radio").get(0).checked = false;
Firebug reports expected values, BUT LABELs do not react to the changes. This is unexpected result and should be fixed. Why? Read further...
c) To overcome the problem above, I trigger LABELs' "click" event instead, like this: Copy code
- $("LABEL.belonging_to_my_disabled_radio_buttons").trigger("click");
It works. BUT what if I "disable" those radio buttons? When I do that, LABELs also reflect that, HOWEVER, the "click" event of those LABELs still work. And I can't control which of those LABELs have disabled radio buttons or not. Well, technically I can, but this would be totally bad from performance standpoint, and from clean coding standpoint. As you can see, this situation creates more and more complications and confusions. Thats why I recommend the code lines in part-B above should also make LABELs look disabled, so that I didn't have to use those LABELs' "click" events.
Thanks.
Replied on the forum http://forum.jquery.com/topic/jquery-ui-buttonset-when-checked-status-of-radio-buttons-change-their-accompanying-labels-do-not-reflect-this-change-in-design