Forum Moderators: coopster

Message Too Old, No Replies

PHP sendmail doesn't return data from select form

         

numerouno

6:17 pm on Sep 30, 2007 (gmt 0)

10+ Year Member



My new HTML form contains a number of drop down select boxes. However when the form is submitted this data does not get emailed, it just comes back blank. I am using the $_POST command to return data.
Can anyone explain why this may be happening?

MrManager

6:35 pm on Sep 30, 2007 (gmt 0)

10+ Year Member



It's hard to say anything without the source code. Did you set the value attributes on the option tags properly?

numerouno

9:58 pm on Sep 30, 2007 (gmt 0)

10+ Year Member



The HTML code for drop down selection box is:

<label for="title"><span>Title</span>
<select name="title">
<option value=>Mr</option>
<option value=>Mrs</option>
<option value=>Miss</option>
<option value=>Ms</option>
<option value=>Dr</option>
</select>
</label>

and PHP Sendmail code for selection box is: $_POST['title']

cameraman

11:46 pm on Sep 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



They don't have values:
<label for="title"><span>Title</span>
<select name="title">
<option value=>Mr</option>
<option value=>Mrs</option>
<option value=>Miss</option>
<option value=>Ms</option>
<option value=>Dr</option>
</select>
</label>

Should be something like
<label for="title"><span>Title</span>
<select name="title">
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Ms">Ms</option>
<option value="Dr">Dr</option>
</select>
</label>