Hi,
I am using radiobuttonlist. I have two radiobutton . if pnlSelectLanguage radiobutton list selected value 0,1,2, then my rblNonfunDuDrySour values 1(Yes) must be show selected other display values of 0(No). How I can do using javascript..
<script src="../Scripts/jquery-1.7.2.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$("#<%=rblLanguage.ClientID%>").change(function () {
SelectedLanguage();
});
});
function SelectedLanguage() {
var sSelectedValue = $("input:radio[name='rblLanguage']:checked").val();
//alert('You have selected ' + sSelectedValue);
alert(rblNonfunDuDrySour.Items[1])
if (sSelectedValue == 1) {
rblNonfunDuDrySour.Items[1].checked = true;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<center>
<h2>Call JavaScript function for RadioButtonList OnChange Event in jQuery?</h2>
<asp:Panel ID="pnlSelectLanguage" runat="server" GroupingText="Select Language" Width="200px">
<asp:RadioButtonList ID="rblLanguage" runat="server" AutoPostBack="false" RepeatDirection="Horizontal">
<asp:ListItem Text="C#" Value="0" ></asp:ListItem>
<asp:ListItem Text="C++" Value="1" ></asp:ListItem>
<asp:ListItem Text="Java" Value="2" ></asp:ListItem>
</asp:RadioButtonList>
<asp:RadioButtonList ID="rblNonfunDuDrySour" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Value="1" Text="Yes" Selected="True"></asp:ListItem>
<asp:ListItem Value="0" Text="No"></asp:ListItem>
</asp:RadioButtonList>
</asp:Panel>
</center>
</div>