Page 1 of 1

Form with <select name=test multiple=yes>

Posted: Wed Oct 04, 2006 4:57 pm
by kingconnections
Ok so I got this form that allows multiple selections. Up to this point I have been using the standard post and get methods for retrieving the values. But on this one it only returns 1 of the multiple selected items. How can I approach this with my get or post statements.

ie

They selected test1 and test2. Normally I do:

Code: Select all

$type= $_POST['type'];
$type would be test2.

any ideas.

Posted: Wed Oct 04, 2006 5:02 pm
by Luke

Code: Select all

<select name="test[]" multiple="yes">

Posted: Thu Oct 05, 2006 9:42 am
by kingconnections
So I just retrieve the the number of values in that array ?

Code: Select all

$type= $_POST[type[0]]; 

$type2= $_POST[type[1]];

Posted: Thu Oct 05, 2006 9:43 am
by volka
$_POST[type][0]

Posted: Thu Oct 05, 2006 10:46 am
by kingconnections
Thanks guys!