note 51449 rejected from reserved.variables by betz
| From: | betz@php.net | Date: | Thu, 31 Mar 2005 11:45:51 +0000 |
| Subject: | note 51449 rejected from reserved.variables by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-87254@lists.php.net to get a copy of this message | ||
Note Submitter: matt at matt-powell dot org dot nz
----
I'm constantly stymied by the fact that unchecked checkboxes are "silent" in
PHP's request variable arrays. Then I realised an additional hidden variable could be used like
this:
<input type="hidden" name="fish" value="0" />
<input type="checkbox" name="fish" value="1" /> I am a fish.
If the checkbox is checked, the new value (1) should overwrite the hidden variable; if not, the
hidden variable acts as a default.
Should this work in all cases?