Jump to content


Photo

pull down menu help


  • Please log in to reply
2 replies to this topic

#1 pixeltrace

pixeltrace
  • Members
  • PipPipPip
  • Advanced Member
  • 577 posts

Posted 18 March 2006 - 06:39 PM

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!!!

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 18 March 2006 - 07:59 PM

select box 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>

php form 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
?>

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).

#3 pixeltrace

pixeltrace
  • Members
  • PipPipPip
  • Advanced Member
  • 577 posts

Posted 19 March 2006 - 03:29 AM

bro,

it work!
thanks a lot bro!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users