johanafm;10990306 wrote:Checkboxes are either set (checked) or not set (unchecked). They take whatever value you give them, just like other input elements do. It's only inputs of type text and password that provide an interface to the user for modifying the value, but wether the user can change the possible values of an input or not doesn't matter. If you want the value 1, specify that.
This is the bit I'm having trouble understanding I think. By default, I'd like the box to be unchecked, however leaving the user with the option of changing that to checked before they submit the form.
Now, if I use this line for the checkbox in the form:
<input type=\"checkbox\" name=\"override\" value=\"1\">
How do I ensure that it only takes the value of '1' forward as a POST value for 'override' if it's checked? In other words, if the box is unchecked when the form is submitted, I want it to assume there is no value.