I have a page where I have N checkbox, of which at least one must be typed before submitting, I have the following but I do not validate check, someone knows why?
The JS code is:
<script type="text/javascript">
$('form').submit(function (e) {
if ($('input[type=checkbox]:checked').length === 0) {
e.preventDefault();
alert('Debe seleccionar al menos un valor');
}
});
</script>
In the picture you can see that the UI has the checks, I have the jquery files loaded and also shows the portion of code that should validate the checks.