I have some radio buttons
&l
I believe you're looking for the select event.
$("input[value='"+data.chartype+"']").select();
<div class="radioVote">
<input type="radio" id="radio1" name="radio" value="1"/><label for="radio1">ONE</label>
<input type="radio" id="radio2" name="radio" value="2"/><label for="radio2">TWO</label>
</div>
$(document).ready(function(){
$( ".radioVote" ).buttonset();
$('[for^=radio]').click(function() {
var theRadioElement = $(this).prev();
alert("Button" + theRadioElement.attr('id') + " clicked. VALUE:" + theRadioElement.val());
});
});
This example shows how to get the ID and Value when you click on a label that belongs to a jQueryUI radio.
Happy coding :)
You have to do it with the label
element added by jQuery UI. Try:
$("label[for='character_chartype_"+data.chartype+"']").click();
Have a look at it here, in a controlled environment: http://jsfiddle.net/B3d4z/