Estoy tratando de habilitar o deshabilitar dos Buttons dependiendo si algún Checkbox está habilitado. Tengo un Checkbox por cada registro en mi tabla HTML, les dejo foto:
Si tengo solo un Checkbox habilitado, sí me habilita los 2 Buttons. Pero el problema es cuando tengo habilitados dos o más Checkbox, si vuelvo a deshabilitar uno, también se deshabilitan los Buttons, aunque tenga más Checkbox habilitados.
Este es mi código JQuery:
`function disableSending(select) {
if (select.checked) {
$('.ar').prop('disabled',false);
} else {
$('.ar').prop('disabled',true);
}
}`
Este es el HTML:
`<input type="checkbox" name="select" id="select" value="<?php echo $row['idIvms']; ?>" onclick="disableSending(this);">
<button type="submit" title="Aceptar" name="accept" id="accept" class="btn btn-outline-success btn-circle btn-sm mx-1 ar">
<i class="fas fa-check"></i>
</button>
<button type="submit" title="Rechazar" name="reject" id="reject" class="btn btn-outline-danger btn-circle btn-sm mx-1 ar">
<i class="fas fa-times"></i>
</button>`
Gracias de antemano!