<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> function rblSelectedValue() { var radio = document.getElementsByName('RadioButtonList1'); for (var i = 0; i < radio.length; i++) { if (radio[i].checked == true) { // document.getElementById('txt1').value = radio[i].value; //document.getElementById('txt1').value = document.getElementById('<%=RadioButtonList2.ClientID%>').value; var value1 = radio[i].value var radio1 = document.getElementsByName('RadioButtonList2'); radio1[i].value = value1; radio1[i].checked = true; //alert(radio[i].value); var CheckBox4 = document.getElementById("CheckBox4"); var CheckBox5 = document.getElementById("CheckBox5"); if (CheckBox4.checked == true) { CheckBox5.checked = true; } } } } </script> </head> <body> <form id="form1" runat="server"> <div> </div> <asp:radiobuttonlist id="RadioButtonList1" runat="server"> <asp:listitem value="1">One</asp:listitem> <asp:listitem value="2">Two</asp:listitem> <asp:listitem value="3">Three</asp:listitem> <asp:listitem value="4">Four</asp:listitem> </asp:radiobuttonlist> <br /> <asp:CheckBox ID="CheckBox1" runat="server" onclick="rblSelectedValue();" Text="click" /> <asp:RadioButtonList ID="RadioButtonList2" runat="server"> <asp:ListItem Value="yes">yes</asp:ListItem> <asp:ListItem Value="no" >no</asp:ListItem> </asp:RadioButtonList> <asp:CheckBox ID="CheckBox4" runat="server" /> <asp:CheckBox ID="CheckBox5" runat="server" /> </form> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)