// HTML
<asp:CheckBox ID="CheckBox1" runat="server" Font-Bold="True" Text="Select" onchange="return SetRadios();"></asp:CheckBox>
<asp:RadioButtonList ID="rdBtnSHG" runat="server" Width="378px" RepeatDirection="Horizontal">
<asp:ListItem Value="1">Add new</asp:ListItem>
<asp:ListItem Value="2">Add+Update</asp:ListItem>
</asp:RadioButtonList>
// JS
function SetRadios() {
if ($('#<%=cbSHG.ClientID%>').is(":checked")) {
$('[id*=rdBtnSHG] :radio[value="1"] ').prop('checked', true);
}
else {
$("#<%= rdBtnSHG.ClientID %> input[type=radio]").prop('checked', false);
}
return false;
}
No comments:
Post a Comment