1
I got this line that’s inside a foreach:
<input type="checkbox" id="idAprovacao" name="idAprovacao"
onclick="atualizaSituacao(<?php echo $resulta->id_aprovacao;?>);"
<?php echo ($resulta->in_situacao == "4") ? "checked disabled" : "" ?> value="">
And I have this function that makes the question exist and if it is accepted does something and if it should not uncheck the checkbox, but this only happens for the first record displayed.
function atualizaSituacao(id)
{
confirma = window.confirm('Esse registro realmente foi lançado no SIGRH?');
var idAprovacao = id;
if(confirma == true) {
// acontece algo
} else {
document.getElementById('idAprovacao').checked = false;
}
}
What’s wrong or missing?
Bro, thank you so much, I knew it was something like that, I just wasn’t sure how to really do it. I spent time trying and decided to come here to ask. Thank you!
– phpricardo
Trying to take advantage of the question now just to leave better what I want, as I leave so that when you mark also stay as disabled the same checkbox?
– phpricardo
document.getElementById('idAprovacao'+id).disabled = true;
– Lucas
He was inventing hahaha thing, but he had the . disabled then.. now good. Thanks.! ;)
– phpricardo