hi,
I have been following the article written by mudassar,
http://www.aspsnippets.com/Articles/Check-Uncheck-all-items-in-ASPNet-CheckBoxList-using-jQuery.aspx
and in my project i need to use the most recent jquery min file.
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$("[id*=chkAll]").bind("click", function () {
if ($(this).is(":checked")) {
$("[id*=chkFruits] input").attr("checked", "checked");
} else {
$("[id*=chkFruits] input").removeAttr("checked");
}
});
$("[id*=chkFruits] input").bind("click", function () {
if ($("[id*=chkFruits] input:checked").length == $("[id*=chkFruits] input").length) {
$("[id*=chkAll]").attr("checked", "checked");
} else {
$("[id*=chkAll]").removeAttr("checked");
}
});
});
</script>
<asp:CheckBox ID="chkAll" Text="Select All" runat="server" />
<asp:CheckBoxList ID="chkFruits" runat="server">
<asp:ListItem Text="Mango" />
<asp:ListItem Text="Apple" />
<asp:ListItem Text="Banana" />
<asp:ListItem Text="Pineapple" />
<asp:ListItem Text="Guava" />
<asp:ListItem Text="Grapes" />
<asp:ListItem Text="Papaya" />
</asp:CheckBoxList>
when you hit select all it's working file. if you repeat the same it's not working. this sample it's not working fiel for latest jquery files. any sugestion to make it work