How to submit value 1 if a checkbox in a checkbox array is checked, and submit 0 if it's unchecked? I tried this but no luck. I am trying to grab this array in a php array when the form is submitted. Please help!
<input id = 'testName0' type = 'checkbox' name = 'check[0]' value = '1' checked>
<input id='testNameHidden0' type='hidden' value='0' name='check[0]'>
<input id = 'testName1' type = 'checkbox' name='check[1]' value = '1' unchekced>
<input id='testNameHidden1' type='hidden' value='0' name='check[1]'>
<input type = 'submit' value = 'Save Changes'>
>
<script>
if(document.getElementById('testName0').checked){
document.getElementById('testNameHidden0').disabled = true;
}
</script>
<script>
if(document.getElementById('testName1').checked){
document.getElementById('testNameHidden1').disabled = true;
}
</script>