Here I have form in HTML
<form>
<input type="text" name ="tes[]" id="tes1">
<input type ="submit" value="Periksa Hasil" name="test">
</form>
Button in the form will use to pass the data in php. That's why I make another button to set the value of form input like this:
<button type="button" onclick="tes_ya(tes1);">Yes</button>
<button type="button" onclick="tes_no(tes1);">No</button>
So, if user click Yes, the value of form input is 1, and if user click No, the value will be 0.
I already make a javascript like this:
function tes_ya(id){
document.getElementById(id).value= 1;
}
function tes_no(id){
document.getElementById(id).value= 0;
}
But I don't know, when I try it, the value can not e set. Is there anyone can help me please? Thank you.