0

im trying to create a form as part of a web site, and i have an idea to list the 3 email addresses that are needed in a drop down menu and when the form is submitted the email goes to the selected person. any ideas how i would do this and whether or not i can, forms have never been my strong point.

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by almostbob
0
<select name='email_address'>
<option value='bob@myplace.com'>Email Bob</option>
<option value='bill@myplace.com'>Email Bill</option>
<option value='ben@myplace.com'>Email Ben</option>
<option value='burt@myplace.com'>Email Burt</option>
</select>

duh thats more than three
but you get the idea

0

yeah i know how to create the drop down menu just not sure how to get the send button to send it to the selected one. sorry i should have mentioned that.

0

form handling in the browser is predefiend
the submit button on a form
sends
text, textarea : name & contents pair
select, checkbox,radio button : name & value pair of selected item

the post array will include
post
($email_address)
with the value of the selected item with no further coding needed,

<form action='./emailhandler.php' method='post'>
<select name='email_address'>
<option value='bob@myplace.com'>Email Bob</option>
<option value='bill@myplace.com'>Email Bill</option>
<option value='ben@myplace.com'>Email Ben</option>
<option value='burt@myplace.com'>Email Burt</option>
</select>
<br>From <input type='text' name='from'><br>
from email <input type='text' name='from_email'><br>
message <textarea cols='50' rows='8' name='message'></textarea>
<br>
<input type='submit' value='send email'></form>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.