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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.