Jump to content

Archived

This topic is now archived and is closed to further replies.

pixeltrace

pull down menu help

Recommended Posts

guys,

i need help,
how can i setup my pulldown menu list in such a way that
i can select multiple items from the list?
what is the code for that?

also the items that will be selected from the lists will be sent via sendmail.
how can i set it up in such a way that it will send all the selected items with commas?
$Message .= ????

hope you guys can help me with this.

thanks in advance!!!

Share this post


Link to post
Share on other sites
select box code:
[code]<select name="selectbox[]" size="5" multiple>
    <option value="1">Option 1</option>
    <option value="2">Option 2</option>
    <option value="3">Option 3</option>
    <option value="4">Option 4</option>
    <option value="5">Option 5</option>
</select>[/code]

php form code:
[code]<?php
//this will put your options in a list...so if 2, 4, and 5 are selected it will print "2, 4, 5"
$selectbox = implode(",", $_POST['selectbox']);
echo $selectbox
?>[/code]

It creates an array for the selectbox value in POST...making POST a multidimensional array. If you want to see the structure, echo "<pre>" then do a print_r($_POST).

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.