I'm trying to use a radios in a grid but They should look like a Button, so I use the buttonset.
I'm able to see the radios as button.
here is are the problems.
1.- I cannot set one of them as Checked by default so the button look highligthed
2.- after ther first row in the grid, the second row is just not taking the properties on the radios, because I can press both at the same time.
3. does it have something to with <label for="(the id of the radio"> ????
here is a little code that I'm using
this part, is a row on the grid.
<td style="text-align: center" rowspan="2">
<div id="views">
<input type="radio" id="button1" name="test" class="ui-helper-hidden-accessible" value="1" checked="true" >
<label for="button1">@Resources.Explosion.New.Current_Interface</label>
<input type="radio" id="button2" name="test" class="ui-helper-hidden-accessible" value="0" >
<label for="button2">Truck</label>
</div>
</td>
and here is part of my jquery where I change the name and the id of the radios in each row...
$("#explosionResults tr").each(function () {
var $radio = $(this).find("tr:eq(1)").find('input[type=radio]');
if ($radio.length > 0) {
$radio[0].name = rowCountername;
$radio[1].name = rowCountername;
//$radio[1].name = rowCountername;
rowCountername += 1;
$radio[0].id = rowCounterid;
$radio[0].for = rowCounterid;
rowCounterid += 1;
$radio[1].id = rowCounterid;
$radio[1].for = rowCounterid;
rowCounterid += 1;
}
});
also remeber that I'm using to format the radios as buttons
$('#views').buttonset();
I appreciate any help on this.