Jump to content

pull down menu help


pixeltrace

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!!!
Link to comment
https://forums.phpfreaks.com/topic/5241-pull-down-menu-help/
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).
Link to comment
https://forums.phpfreaks.com/topic/5241-pull-down-menu-help/#findComment-18624
Share on other sites

Archived

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

×
×
  • Create New...

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.