gnawz Posted August 24, 2007 Share Posted August 24, 2007 i have a multiple drop down with five items.. If i select 2 or more items and post, only one item is posted to the db! How do I make it post all the fields I have selected? The HTML list <select name="txtservice" size="3" id="txtservice" multiple> <option value="1">Wrapping and Storage</option> <option value="2">Logistics and warehousing supervision </option> <option value="3">Loading and Unloading</option> <option value="4">Packing and Labelling</option> </select> PHP for getting variable $service = $_POST["txtservice"]; And how can I validate this multiple select? Quote Link to comment https://forums.phpfreaks.com/topic/66471-posting-and-validating-multiple-select/ Share on other sites More sharing options...
btherl Posted August 24, 2007 Share Posted August 24, 2007 Try naming your variables txtservice[] in the html, and then reading as an array in php. You can also do this by reading the raw post data, but that's a hassle. Quote Link to comment https://forums.phpfreaks.com/topic/66471-posting-and-validating-multiple-select/#findComment-332812 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.