i am using asp.net c# jquery vs 2008
I have two check box list (cbList,checkboxList1) and one check box (chkALL). when i checked the check box(chkALL),it should check all checkboxes in Check box list(CbList)
I am using the following code in jquery.It is not working properly.It checks both checkbox list.I need to check only one checkboxlist. Any help appreciated
<script type="text/javascript" src="jquery-1.6.4.js"></script>
<script type="text/javascript">
function jqCheckAll2(id, name) {
$("INPUT[@Name=" + name + "][type='checkbox']").attr('checked', $('#' + id).is(':checked'));
}
</script>
<form id="form1" runat="server">
<div>
<asp:CheckBox ID="chkAll" runat="server" Text="Check All" onclick="jqCheckAll2( this.id, 'cbList' )"/><br />
<asp:CheckBoxList ID="cbList" runat="server">
</asp:CheckBoxList>
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
</asp:CheckBoxList>
</div>
</form>