Click to See Complete Forum and Search --> : Sendig multiple values.


ricosushi
08-19-2005, 05:53 PM
Hi.

I have trouble sending multiple values from an form using a <SELECT MULTIPLE> element.

When i select multiple values it only returns the last value selected and what i want its to get and array of the values selected.

////////////////////// EXAMPLE ///////////////////

<FORM name="form1" method="get" action="multiple.php">
<P>
<SELECT name="select" size="1" multiple>
<OPTION value="1">uno</OPTION>
<OPTION value="2">dos</OPTION>
<OPTION value="3">tres</OPTION>
</SELECT>
</P>
<P>
<INPUT type="submit" name="Submit" value="Submit">
</P>
</FORM>
<?php print_r($_GET['select']); ?>

///////////////////////////////////////////////////////////////////

you can try the example here
http://www.luiszuno.com/libro_amp/cap6/multiple.php

bokeh
08-19-2005, 07:21 PM
You can only choose one check box per select tag.

NogDog
08-19-2005, 07:25 PM
<SELECT name="select[]" size="1" multiple>

When submitted to the PHP form-handler, $_POST['select'] will now be an array of the values selected by the user.

ricosushi
08-22-2005, 09:46 AM
It worked just right.

Thanks NogDog