I have 2 different checkboxes, one to choose the type of registration and another to choose type of course, both are mandatory. Can someone help me with the function that allows you to select a choice of 2 checkboxes. At this moment I mark one, the other when I'm going to score, uncheck the previous one.
$('input[type="checkbox"]').on('change', function() {
$('input[type="checkbox"]').not(this).prop('checked', false);
if ($('#teste').is(':checked')) {
$('input[type="checkbox"]').is(':checked');
} else {
$('#teste').prop('checked', false);
}
});
HTML -
<label class="ckbx">
<input type="checkbox" class="validate[minCheckbox[1], maxCheckbox[1]]"
id="geral1" name="tipo[]" value="2" style=" margin-top:15px;">
<?php if($lng=='pt') echo"Membro da Comissão de Programa, 150 €"?><?php if($lng=='en') echo"Members of Programme Comittee, 150€"?>
</label>
<input type="checkbox" id="teste" class="validate[minCheckbox[1], maxCheckbox[1]]" name="produto[]" value="1">