I am using this code to check if the user select less checkbox than total checkbox and so to show jquery confirm if the user want to continue or not. if the confirm popup appears because the user select less checkbox the form don't submit anything. What's the error?
JAVASCRIPT
var modulo = $("[type='checkbox']").length;
var count = $("[type='checkbox']:checked").length;
if (count < modulo) {
$.confirm({
boxWidth: '30%',
useBootstrap: false,
title: 'Conferma',
type: 'red',
content: 'You have selected ' + count + ' objects of ' + modulo + '. Do you want to proceed?',
buttons: {
'
confirm ': {
text: 'Yes',
btnClass: 'btn-info',
action: function() {
$("#veicoli").submit();
}
},
'No': function() {}
}
});
return false;
} else {
return true;
}
HTML
<form name="veicoli" id="veicoli" method="post" action="page.php" >
<input type="checkbox" name="rinnovo[44058]" value="renewal" />
<input type="checkbox" name="rinnovo[44059]" value="renewal" />
<input type="checkbox" name="rinnovo[44060]" value="renewal" />
<input type="checkbox" name="rinnovo[44061]" value="renewal" />
<button type="submit" name="compRinnovo" value="Prosegui" onClick="return verifica(this);">Send</button>
</form>