Posted form values - checkbox problem
| From: | Michael Kimsal | Date: | Mon, 18 Dec 2000 21:51:27 +0000 |
| Subject: | Posted form values - checkbox problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-30937@lists.php.net to get a copy of this message | ||
<input type="checkbox" name="cow">
<input type="checkbox" name="pig">
<input type="checkbox" name="dog">
If cow is 'checked', I get $cow="on",
but if cow is left unchecked, I get $cow="".
If I knew the names of the variables I was
getting, I could check to see if they were 'on' or '',
but I don't know. I'm getting an array of disparate
values, and I can't tell which checkboxes were on
or off, only those that were on.
Any ideas, short of including a separate hidden value that
tells me which variable names I'll be getting?
--
==========================
Michael Kimsal
http://www.tapinternet.com
PHP Training courses
http://www.tapinternet.com/php