I have a grid in which I have 1 coulmns has
checkboxes
.I want to disable a button when all the checkbox are disabled or unticked(uncheked)
You can do something like the following, but you'll need to update it with more specific selectors so it doesn't affect all checkboxes and buttons:
JS Fiddle
$('input[type=checkbox]').change(function(){
var count = $('input[type=checkbox]:checked').length;
$('button').prop('disabled', count == 0);
});
And if you need it on load as well:
JS Fiddle
$('input[type=checkbox]').change(function(){
disableCheckbox();
});
disableCheckbox = function() {
var count = $('input[type=checkbox]:checked').length;
$('button').prop('disabled', count == 0);
};
disableCheckbox();