...

View Full Version : Emailing form data



AlphonseElric
08-10-2005, 08:03 AM
I need to email a summary form to the receipt but i couldnt capture the form data to Outlook's textfield. Can someone give me some pointers? I have tried using mailto at form header but to no avail..Or is there any other way to do this???

Johnny Lang
08-10-2005, 11:45 AM
<HTML>
<Head>
<Script Language=JavaScript>

function sendMail(isForm){

isBody = "";
recipient = "me@someDomain.com";
isSubject = "Form Data";
isBody = "Name: " + isForm.personal.value +"%0D%0A";
isBody += "Address: " + isForm.address.value +"%0D%0A";
isBody += "City: " + isForm.city.value +"%0D%0A";
isBody += "State: " + isForm.state.value +"%0D%0A";
isBody += "Zip: " + isForm.zip.value;
document.forms.Send.action = "mailto:"+recipient+"?subject="+isSubject+"&body="+isBody+"&nbsp";
}

</Script>
</Head>
<Body>
<Form name='Form1'>
Name <input name='personal' value="John Doe" size=25><br>
Address <input name='address' value="123 Main Street" size=30><br>
City <input name='city' value="Springfield" size=15> State <input name='state' value="OH" size=2><br>
Zip Code <input name='zip' value="12345" size=4><br>
</Form>
<Form name='Send' action=''>
<input type="submit" value="Send by Email" onclick="sendMail(document.Form1)">
</Form>
</Body>
</HTML>

AlphonseElric
08-11-2005, 02:03 AM
Thanks a lot, ur a great help.

cheers~

AlphonseElric
08-11-2005, 04:42 AM
isBody += "State: " + isForm.state.value +"%0D%0A";

does this kind of line usable for radio buttons???



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum