Jump to content

submitting Menu Items


jrapin

Recommended Posts

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";
Link to comment
https://forums.phpfreaks.com/topic/27922-submitting-menu-items/
Share on other sites

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]
Link to comment
https://forums.phpfreaks.com/topic/27922-submitting-menu-items/#findComment-127701
Share on other sites

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]
Link to comment
https://forums.phpfreaks.com/topic/27922-submitting-menu-items/#findComment-127705
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.