I want to validate that the user has to select all checkbox
to insert something. I have validated that I select only one, but I can not get it all.
My code php
:
while ($imprime = $resultado->fetch_assoc()) {
$tabla .= '<tr>';
$tabla .= '<td>' . $imprime["DESCRIPCION"] . '</td>';
$tabla .= '<td><input class="checkRequi" name="checkRequi" type="checkbox" value=""></td>';
$tabla .= '</tr>';
}
In jQuery
I check that it is selected:
$(document).ready(documentoListo);
function documentoListo () {
$("#asigBen").click(compruebaChec)
}
function compruebaChec () {
if ($("input[name=checkRequi]").is(":checked")) { //quiero que compruebe todos seleccionados
alert("La política de privacidad ha sido aceptada");
return true;
} else {
alert("Debe aceptar la política de privacidad");
return false;
}
}