I have a
<asp:Button ID="BtnAddCart" runat="server" Text="Place Order" Width="147px"
onclick="BtnAddCart_Click" Enabled="false"/>
and a checkbox column and checkbox header on a gridview. on the header you select the checkbox all items on the grid are selected. If you uncheck the header checkbox the items on the grid are un selected.
here is the Jquery
<script type="text/javascript">
$(document).ready(function () {
var chkBox = $("input[id$='ChkAll']");
chkBox.click(
function () {
$("#MainContent_ProductGrid INPUT[type='checkbox']")
.attr('checked', chkBox
.is(':checked'));
$("#MainContent_BtnAddCart INPUT[type='submit']").removeAttr('disabled');
});
// Uncheck
$("#MainContent_ProductGrid INPUT[type='checkbox']").click(
function (e) {
if (!$(this)[0].checked) {
chkBox.attr("checked", false);
}
$("#MainContent_BtnAddCart INPUT[type='submit']").attr('disabled', 'disabled');
});
});
</script>
why is the button not getting enabled and disabled.