JPark Posted July 15, 2009 Share Posted July 15, 2009 This should be easy but it's driving me CRAZY! All I want is two list/menus where the customer can select one or more options (using Cntl). For some reason, I cannot get all of the values to be sent to the entry page. If I select 3 states, I only get the last one. (If I use checkboxes though, I can get all the values; of course, I don't want checkboxes... grrr). Here is a tiny bit of my code: <select name="states" size="10" multiple="yes"> <option value="Alabama" name="states[]">Alabama</option> <option value="Alaska" name="states[]">Alaska</option> <option value="Arizona" name="states[]">Arizona</option> <option value="Arkansas" name="states[]">Arkansas</option> <option value="California" name="states[]">California</option> </select> And then on the entry page, I have tried print_r ($_POST['states']); or echo $_POST['states'];, expecting to see "array". All I get is the last value. What am I missing?? Thanks! Joe Quote Link to comment Share on other sites More sharing options...
ronnie88 Posted July 15, 2009 Share Posted July 15, 2009 <select name="states[]" size="10" multiple="yes"> <option value="Alabama" name="state1">Alabama</option> <option value="Alaska" name="state2">Alaska</option> <option value="Arizona" name="state3">Arizona</option> <option value="Arkansas" name="state4">Arkansas</option> <option value="California" name="state5">California</option> </select>[code] Quote Link to comment Share on other sites More sharing options...
JPark Posted July 15, 2009 Author Share Posted July 15, 2009 That's it?!?! That's all I was missing?!?? Jeez! Somebody must have switched in decaf. Thanks much!! Joe 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.