Hey try to change your check function like the following thing:
<script>
function check() {
var ele = document.getElementById('check');
var flag = 0;
if (ele.checked) {
flag = 1;
}else{
flag = 0;
}
if (flag == 1) {
document.getElementsByClassName('valider')[0].disabled = true;
} else {
document.getElementsByClassName('valider')[0].disabled = false;
}
}
</script>
and change too in html the following line:
<button class="valider" type="submit" formaction="./signCheck" formmethod="get" disabled><i class="fas fa-sign-in-alt"></i> S'inscrire</button>
disabled with not equal.
Hope that could help you!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…