Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help !!!! I think i'm out of my

Status
Not open for further replies.

St0rm

MIS
Oct 19, 2000
23
0
0
GB
Help !!!!

I think i'm out of my depeth on this, I'm trying to create a feedback page that will email the comments made back to an email address the user select from a list.

Sorry if this is the wronge area to post but seemed to be the most aproprate one to use.

Please if you can help explain it well.

Thank you very much in advance
 
If I understood you correctly, you want to send feedback to a chosen e-mail from a select list.

Try this code: (works well in IE, somewhat good in NS)
<HTML>
<HEAD>
<TITLE> Feedback page </TITLE>
<script language=&quot;JavaScript&quot;>
function feedback(toemail){
// set action, method and enctype
// toemail is a parameter that comes
// from select list
document.feedbackform.action = &quot;mailto:&quot; + toemail document.feedbackform.method = &quot;post&quot;;
document.feedbackform.enctype = &quot;text/plain&quot;;
// the result from enctype depend on e-mail client program
}
</script>
</HEAD>

<BODY>
Feedback page<hr>
<form name=&quot;feedbackform&quot; onSubmit=&quot;feedback(this.fsel.options[this.fsel.selectedIndex].value)&quot;>
Enter your name: <input type=&quot;text&quot; name=&quot;fname&quot;><br>
Enter your email: <input type=&quot;text&quot; name=&quot;femail&quot;><br>
Comments: <textarea name=&quot;comments&quot;></textarea><br>
Comments apply to :
<select name=&quot;fsel&quot;>
<option value=&quot;someone@some.com&quot; selected>
someone@some.com
</option>
<option value=&quot;sometwo@some.com&quot;>
sometwo@some.com
</option>
</select>
<br>
<input type=&quot;Submit&quot; value=&quot;Send your feedback&quot;>
</form>

</BODY>
</HTML>

More sofisticated variant is:

<HTML>
<HEAD>
<TITLE> Feedback page </TITLE>
<script language=&quot;JavaScript&quot;>
function feedback(toemail,feedname,feedemail,comments){
document.feedbackform.action = &quot;mailto:&quot; + toemail + &quot;?subject=Feedback&body=Feedback from: &quot; + feedname + &quot; ;&quot; + &quot;email: &quot; + feedemail + &quot; ;&quot; + &quot;Comments: &quot; + comments;
document.feedbackform.method = &quot;post&quot;;
document.feedbackform.enctype = &quot;text/plain&quot;;
}
</script>
</HEAD>

<BODY>
Feedback page<hr>
<form name=&quot;feedbackform&quot; onSubmit=&quot;feedback(this.fsel.options[this.fsel.selectedIndex].value, this.fname.value, this.femail.value, this.comments.value)&quot;>
Enter your name: <input type=&quot;text&quot; name=&quot;fname&quot;><br>
Enter your email: <input type=&quot;text&quot; name=&quot;femail&quot;><br>
Comments: <textarea name=&quot;comments&quot;></textarea><br>
Comments apply to : <select name=&quot;fsel&quot;>
<option value=&quot;someone@some.com&quot; selected>someone@some.com</option>
<option value=&quot;sometwo@some.com&quot;>sometwo@some.com</option>
</select>
<br>
<input type=&quot;Submit&quot; value=&quot;Send your feedback&quot;>
</form>

</BODY>
</HTML>

Success!
 
thanks, that works well :)

Is the a way to sent the mail without the MSG box and the email itself opening?

thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top