apamphilon

Disable submit button if no checkbox/radio is selected

var $submit = $('.job-aside input[type=submit]');
$checkbox = $('.job-aside input[type=checkbox]');

$submit.prop('disabled', true);

$checkbox.on('click', function(){
    if ($("input:checkbox:checked").length > 0) {
        $submit.removeAttr('disabled');
    }else{
        $submit.prop('disabled', true);
    }
});

credit


Comments: