pixeltrace Posted March 18, 2006 Share Posted March 18, 2006 guys,i need help, how can i setup my pulldown menu list in such a way thati 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!!! Quote Link to comment https://forums.phpfreaks.com/topic/5241-pull-down-menu-help/ Share on other sites More sharing options...
hitman6003 Posted March 18, 2006 Share Posted March 18, 2006 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). Quote Link to comment https://forums.phpfreaks.com/topic/5241-pull-down-menu-help/#findComment-18624 Share on other sites More sharing options...
pixeltrace Posted March 19, 2006 Author Share Posted March 19, 2006 bro,it work!thanks a lot bro! Quote Link to comment https://forums.phpfreaks.com/topic/5241-pull-down-menu-help/#findComment-18722 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.