<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <%--<script type="text/javascript"> i have checkboxes </script>--%> <body> <form id="form1" runat="server"> <div> <asp:CheckBox ID="chk1" runat="server" Text="IAS" /> <asp:CheckBox ID="chk2" runat="server" Text="PCS" /> <br /> <br /> <br /> <br /> <asp:CheckBox ID="chk3" runat="server" Text="This is IAS" /> <asp:CheckBox ID="chk4" runat="server" Text="This is PCS" /> </div> </form> </body> </html>
$(document).ready(function (){ $("#chk1").click(function() { $("#chk3").checked(true); }); });
<asp:CheckBox ID="chk1" onclick="chkSlct();" runat="server" Text="IAS" /> <asp:CheckBox ID="chk2" runat="server" Text="PCS" /> <br /> <br /> <br /> <br /> <asp:CheckBox ID="chk3" runat="server" Text="This is IAS" /> <asp:CheckBox ID="chk4" runat="server" Text="This is PCS" /> function chkSlct() { if (document.getElementById("<%=chk1.ClientID%>").checked == "true") { document.getElementById("<%=chk3.ClientID%>").checked = true; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)