jquery buttonset()
Posted
by Kevin
on Stack Overflow
See other posts from Stack Overflow
or by Kevin
Published on 2010-05-11T10:21:41Z
Indexed on
2010/05/11
10:34 UTC
Read the original article
Hit count: 788
Hi - I'm using the jquery buttonset() on a set of radio buttons (to tart them up). I'd like to be able to set the selected radio button on another user event. I've been looking into this and while I can set the selected radio button, but I cannot also (easily) update the UI to indicate what the selected radio button is.
From what I can tell, I need to call this to set the radio button at index n to be checked
$('input[name="transactionsRadio"]')[n].checked = true;
And then do some convoluted jquery selector calls to remove the ui-state-active from one lable and apply it to the new label.
Is this really the most optimal way to do this ? I had expected an equivalent method to the 'activate' method that is available for the jquery Accordian control.
Any more elegant solution would be appreciated!
Thanks, Kevin.
© Stack Overflow or respective owner