RE: [PHP] Possibly more of an html question, but...
| From: | Jason | Date: | Mon, 03 Jul 2000 21:33:36 +0000 |
| Subject: | RE: [PHP] Possibly more of an html question, but... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4579@lists.php.net to get a copy of this message | ||
Try something like this:
<select name="select_test[]" multiple>
<option value="selection_1">Number 1
<option value="selection_2">Number 2
<option value="selection_3">Number 3
...
<option value="selection_n">Number n
</select>
HTML supports an array datatype(sort of).
Jason
> -----Original Message-----
> From: Fredrik de Vibe [mailto:fredrik@devibe.net]
> Sent: Monday, July 03, 2000 3:29 PM
> To: php-general@lists.php.net
> Subject: [PHP] Possibly more of an html question, but...
>
>
> ...I'll give it a go here and hope nobody strings me up.
>
> The html tag <select> has an option "multiple", meaning that you can
> select more than one option. The <select> tag has the "name" attribute
> and the enclosed <option> tags have the "value" attributes.
>
> I'll give a slight example describing my problem:
> ---
> <select name="select_test" multiple>
> <option value="selection_1">Number 1
> <option value="selection_2">Number 2
> <option value="selection_3">Number 3
> ...
> <option value="selection_n">Number n
> </select>
> ---
> Here, you'll get a selection box where you can select as many options as
> you'd like. That's html.
>
> The php (and as far as I can see without having tried it, also cgi)
> related problem is that when I try to pick up these values in a variable
> in a script, I only get the last value, as I can see, the following
> happens in php:
> ---
> $selection_test = Number 1;
> $selection_test = Number 2;
> $selection_test = Number 3;
> ...
> $selection_test = Number n;
> ---
> meaning that $selection_test is over-written each time you read a new
> value. I've also tried handling $selection_test as an array, but if I
> understand this correctly, it isn't one.
>
> Surely there must be a solution to this as I've seen multiple selection
> boxes being used, but whatever this solution is, it's bypassed me. Does
> anybody know how to deal with this?
>
>
> --Fredrik
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
_______________________________________________________
Site Design, Hosting, and E-Commerce at www.webpipe.net