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> Quote Link to comment 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;"> Quote Link to comment 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.