Programming Tutorials

Comment on Tutorial - FAQ: Why are my checkboxes not being set from ON to OFF? By Apache Foundation



Comment Added by : Stray

Comment Added at : 2010-01-05 08:07:47

Comment on Tutorial : FAQ: Why are my checkboxes not being set from ON to OFF? By Apache Foundation
You can also include a hidden field of the same name preceding the checkbox. Assign this field the opposite value as the checkbox. If the checkbox is checked upon submission, the checkbox value is sent, otherwise the preceeding value is sent.

<INPUT TYPE=HIDDEN NAME=ENABLED VALUE=0>
<INPUT TYPE=CHECKBOX NAME=ENABLED VALUE=1> // We display enabled twice in order to pass the correct value even when not checked


View Tutorial