0
Guys I got this input
:
<input type="submit" id="cadastrar" value="Cadastrar" disabled>
I have a grid that is filled and each line has one checkbox
:
<td>
<input type="checkbox" id="seleciona" name="seleciona[]" value= <=$row_questao['codprova'] ?>" />
</td>
I have this script that when I click only on the first checkbox
from Grid it enables and disables, from 2nd onwards it does not work:
$(document).ready(function () {
$("#seleciona").on('change', function () {
if ($(this).is(':checked')) {
$("#cadastrar").prop('disabled', false);
} else {
$("#cadastrar").prop('disabled', true);
}
});
});
I need him to stay enabled
when a quantity x will come from a mysql query checkbox
is selected and when you deselect 1 of the total it returns to disabled
.
hi, try to supplement your code as much as possible of the result, with the rest of html to perform a test, if possible make your code available inside the snippet in the question editor.
– ElvisP
hello, the rest to complement would be html unimportant.
– Expresso 1002