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
A better solution that solved this for me.
Problem: Both the hidden and the checked were sending to my server.
Solution:
if len(key) == 1 {
value = false
} else {
value = true
}
This way, if len(key) is 1 I know that only the hidden field was being send. Any other scenario means that the box is checked. Simple and easy.