Re: CheckBoxes....
| From: | Jeff Sheltren | Date: | Sun, 03 Mar 2002 05:25:59 +0000 |
| Subject: | Re: CheckBoxes.... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-86951@lists.php.net to get a copy of this message | ||
As far as I know, you can't name different checkboxes with the same name (seems odd to me to do this anyway...). When you submit a form to a php page, the php page will have a variable for each input item in your form. So if you have checkbox items named, "a", "b", "c", and "d", and submit a form with "a" and "c" checked, then the values of $a and $c will be "on", and $b and $d will have no values. It's sometimes good to use the isset() function on checkbox items. In this case, isset($a) would return 1 and isset($b) would return 0. Hope that helps.
Jeff
At 10:07 PM 3/2/2002 -0700, Ben Turner wrote:
Don't checkboxes, if you name them all the same name, produce a comma delimited string in php of the values selected??? such as for 15 checkboxes with numeric values would produce a string such as.... ,,,,,,,13,,,,14,,,18 when the form was submited?? This is the way it was handled in ASP... is there something different for PHP? thanks! Ben