I know this has been asked before, but it is not working for my scenario. I have a jquery ui modal form which contains a radiobuttonlist with static values:
<asp:RadioButtonList ID="rblSlots" runat="server" ViewStateMode="Disabled">
<asp:ListItem Value="30" enabled="false">30 Minutes</asp:ListItem>
<asp:ListItem Value="60" enabled="false">1 Hour</asp:ListItem>
<asp:ListItem Value="90" enabled="false">1 1/2 Hours</asp:ListItem>
<asp:ListItem Value="120" enabled="false">2 Hours</asp:ListItem>
<asp:ListItem Value="150" enabled="false">2 1/2 Hours</asp:ListItem>
<asp:ListItem Value="180" enabled="false">3 Hours</asp:ListItem>
</asp:RadioButtonList>
Which of course renders as:
<table id="rblSlots">
<tr>
<td><span disabled="disabled"><input id="rblSlots_0" type="radio" name="rblSlots" value="30" disabled="disabled" /><label for="rblSlots_0">30 Minutes</label></span></td>
</tr><tr>
<td><span disabled="disabled"><input id="rblSlots_1" type="radio" name="rblSlots" value="60" disabled="disabled" /><label for="rblSlots_1">1 Hour</label></span></td>
</tr><tr>
<td><span disabled="disabled"><input id="rblSlots_2" type="radio" name="rblSlots" value="90" disabled="disabled" /><label for="rblSlots_2">1 1/2 Hours</label></span></td>
</tr><tr>
<td><span disabled="disabled"><input id="rblSlots_3" type="radio" name="rblSlots" value="120" disabled="disabled" /><label for="rblSlots_3">2 Hours</label></span></td>
</tr><tr>
<td><span disabled="disabled"><input id="rblSlots_4" type="radio" name="rblSlots" value="150" disabled="disabled" /><label for="rblSlots_4">2 1/2 Hours</label></span></td>
</tr><tr>
...etc...
in my form opener dialog i make an ajax post to grab some vaues from my webservice among them 'timespan' in the following javascipt, i have set timespan to a static variable for debugging, i want to enable the radio buttons which are <= timespan.
var strTS = "30,60,90,120,150,180";
var aryTS = strTS.split(",");
var timespan = 120;
for (i = 0; i <= 5; i++) {
if ($('#rblSlots [value=' + aryTS[i] + ']').val() <= timespan) {
$('#rblSlots [value=' + aryTS[i] + ']').removeAttr("disabled");
}
}
$("#appointment-form").dialog("open");
return false;