You can wrap the
Ajax
call in the checkbox change event. Here is an example.
$( "#check1" ).change(function() {
var $input = $( this );
if ($input.is( ":checked" )) {
}
}).change();
Since you mentioned " same ajax call ", I would suggest place the Ajax call into a method so that it can be shared between the button and checkbox event.
.prop() | jQuery API Documentation[
^]