jrapin Posted November 21, 2006 Share Posted November 21, 2006 Hello. I've generated a php form that allows a user to make a selection from a drop-down and submit the results to a e-mail address. (Thanks to Orio). Everything is working nicely however, the selection from the menu is not being processeed into the e-mail body. Can someone please tell me why it is not sending ALL the data to the correct place? IN the return e-mail, I'm just getting, "you have selected _____ as your choice". Here is the code I'm using:<select fruit ="fruit"><option value="">Choose a Fruit</option><option value="">Apples</option><option value="">Cherries</option><option value="">Grapes</option><option value="">Oranges</option></select> <select amount ="amount"><option value="">Amount</option><option value="">One </option><option value="">Two </option><option value="">Three </option><option value="">Four </option><option value="">Five </option></select> $message .= "You have selected ".$_POST['fruit']." ".$_POST['amount']." as your food choice\r\n"; Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted November 21, 2006 Share Posted November 21, 2006 You need to put something for the value attribute...or I think just removing it will cause it to default to the text in the option.[code]<select amount ="amount"><option>Amount</option><option value="One">One </option><option value="Two">Two </option></select>[/code] Quote Link to comment Share on other sites More sharing options...
jcbarr Posted November 21, 2006 Share Posted November 21, 2006 You are correct, you either have to set a value or leave it out all together. The way that you have it coded will give every option a null or blank value, thus submitting no actual data to the form processor.And I also think that it should be[code]<select name="fruit">[/code] 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.