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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Submission Via E-Mail

Status
Not open for further replies.

bdasp1

Technical User
Jan 9, 2002
11
0
0
US
Hello all,

I have created a simple HTML form that I email to my clients to fill out. I have created a submit button and this brings up an email addressed to me.

How do I get the completed form (or just form fields) into the body of this email? In other words, what script would I use to specify the onclick or onsubmit function and where would I place this within my code?

Thank you all.
 
have something like this in the <head> of your page:
Code:
<script language=&quot;javascript&quot;><!--
function sendit(){
var1 = document.formname.inputname.value;
var2 = document.formname.inputname2.value;
var therest = &quot;?subject=Form%20Info&body=The%20Form%20Value%Is%20As%20Follows%20%20%20&quot; + var1 + &quot;%20&quot; + var2;
document.location=&quot;mailto:me@mydomain.com?&quot; + therest;
// in &quot;document.formname.inputname.value&quot; formname = the 
// name of your form, and inputname = the name of your input
}
//--></script>
now change the action in your form to the function above..like so:
Code:
<form action=&quot;
sendit()
Code:
&quot;>

hope it helps Suceess, thats the way you spell success!
Got a question? Ask IMOZRMY!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top