Re: SELECT tags in PHP, addressing selected options
| From: | Jeff | Date: | Fri, 29 Sep 2000 04:17:23 +0000 |
| Subject: | Re: SELECT tags in PHP, addressing selected options | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-17997@lists.php.net to get a copy of this message | ||
You can address them as an array. Use
<SELECT NAME="list[]" MULTIPLE?>
<OPTION>Choice1</OPTION>
<OPTION>Choice2</OPTION>
etc....
The script that receives it will have a $list[] array
that you can loop through and process each item.
Hope this helps.
Jeff
Liam Gibbs wrote:
>
> I'm having a problem with PHP/HTML. My problem is this:
>
> I have a <SELECT NAME = "list" MULTIPLE> list box in an HTML form. In that,
> obviously, users can select multiple choices. They click the submit button. The action for the form
> is to submit it to a PHP page which will list all of the selected options, which are
> <OPTION>Choice1</OPTION>.
>
> But how? I can't figure out how to address those selected options. Would it be $Choice1?
> Should I include a NAME attribute? Does anyone know how to address these options?
>
> Liam Gibbs