Last active
December 20, 2015 10:09
-
-
Save jamesfinley/6113418 to your computer and use it in GitHub Desktop.
The problem with a checkbox field is that it only has one value and that value is only sent when it is checked. Optimally, it would have an on and off value. To compensate for that, I include a hidden field before the checkbox, with the same name, that contains the off value. When the checkbox is checked, the checkbox value is sent. When it is u…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="hidden" name="show_pictures" value="0" /> | |
<input type="checkbox" id="show_pictures_field" name="show_pictures" value="1" /> | |
<label for="show_pictures_field">Show Pictures</label> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment