It’s time for me to solve the mystery of HTML unchecked checkbox values. I guess it would be the most searched trick about basic HTML forms and checkboxes. When you use checkboxes on our website, you save some values to the checkboxes, but how do you save the unchecked value to it?
I had a same problem when I was working on a recent project of mine, but I searched and found a great solution of this problem on iamcam. The solution is inserting a hidden form field with the same name as our checkbox and put the default value right before the place where the checkbox is located in our form:
<input type="hidden" name="box1" value="0" />
<input type="checkbox" name="box1" value="1" />
When the checkbox is left unchecked by the user, the hidden field’s value gets submitted. #PandaPower