Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery buttonset()

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!

like image 536
Kevin Avatar asked May 11 '10 10:05

Kevin


1 Answers

$("#yourInput").attr("checked", true).button("refresh");
like image 184
David Perlman Avatar answered Oct 31 '22 14:10

David Perlman