DeanWhitehouse Posted September 19, 2008 Share Posted September 19, 2008 I have made a multiple select box, but when i echo the post , its value is always the last selected option, how can i get all the options? This is some of the code <?php if(isset($_POST['request_choices'])) { echo $_POST['request_choices']; } ?> <form action="?site=<?php echo $_GET['site'];?>" method="post"> Request a report regarding '<?php echo $site; ?>' <span style="font-size:smaller"><a href="Javascript:void();">Change Site</a></span><br> <br> <span style="font-size:small">If you do not wish to recieve a general overview please select the areas you wish to be in the report,otherwise leave blank.</span><br><span style="font-size:smaller;">To select multiple options , hold down the ctrl key.</span><br> <select name="request_choices" multiple="multiple" style=" width:170px;height:70px;"> <option value="price">Price</option> <option value="completion">Completion Time</option> <option value="progress">Progress</option> <option value="features">Feature List</option> </select> <br><br> If you have any other querys or questions enter them into the text area below.<br> <textarea rows="5" cols="50" name="extra_comment"></textarea><br> <input type="submit" style="height:20px;" name="report" size="10" value="Request Report"> </form> Link to comment https://forums.phpfreaks.com/topic/124879-solved-multiple-select-options/ Share on other sites More sharing options...
F1Fan Posted September 19, 2008 Share Posted September 19, 2008 Add [] to your select name, so: <select name="request_choices[]" multiple="multiple" style=" width:170px;height:70px;"> Link to comment https://forums.phpfreaks.com/topic/124879-solved-multiple-select-options/#findComment-645262 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.