POST and multiple select

B

Bert Apperlo

Hi,

How can I send all selections made in a multiple select box?

Example:
I made a multiple selection box which has 9 values (1 to 9). I select a
couple of values (e.g. 1,4,9,5 and in the order I mention). When I submit
the form and I display the content of the POST variable (through php), I
see that only the 9 is returned.

How can I make it that every selected item is returned?

Bert Apperlo
 
B

Benjamin Niemann

Bert said:
How can I send all selections made in a multiple select box?

Example:
I made a multiple selection box which has 9 values (1 to 9). I select a
couple of values (e.g. 1,4,9,5 and in the order I mention). When I submit
the form and I display the content of the POST variable (through php), I
see that only the 9 is returned.

How can I make it that every selected item is returned?

You'll have to append '[]' to the name of the SELECT element. Then the
variable in $_POST will be an array with all selected values.
 
A

Alan J. Flavell

How can I send all selections made in a multiple select box?

They already *are* being sent. Your problem, as B.N has shown,
is that you aren't asking for them properly. And this will be the
same for all other multi-valued form submission data.

ttfn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top