Kevin
Kevin

Reputation: 11662

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!

Upvotes: 5

Views: 11724

Answers (1)

David Perlman
David Perlman

Reputation: 1470

$("#yourInput").attr("checked", true).button("refresh");

Upvotes: 7

Related Questions