From the current selection of the checkbox, how to check the next checkbox element and disable all other checkboxes.
I have this code, which when marking a checkbox consequently all the others are disabled, but I need that when marking a checkbox automatically it marks the next checkbox and deactivates the others.
I tried the next () but I did not succeed
$(document).ready(function(){
$('#formNine input:checkbox').click(function(){
var $inputs = $('#formNine input:checkbox')
if($(this).is(':checked')){
$inputs.not(this).prop('disabled',true); // <-- disable all but checked one
}else{
$inputs.prop('disabled',false); // <--
}
});
});