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

Mailto Textarea as Body 1

Status
Not open for further replies.

EAS

Programmer
May 21, 2001
25
GB
Hi
I have a suggestion form and I want to include the contents of a textarea input box as the body of an email. I cant work out the syntax. Can anyone help? My syntax so far is:

<form method=&quot;POST&quot; name=&quot;Suggestions&quot; action=&quot;mailto:me@somewhere?Subject=Your Suggestions For Improvement&body=what goes here&quot;>

Thanks in advance

Liz
 
Hi Liz,

Try this:

<SCRIPT language=&quot;JavaScript&quot;>
function MailTextarea(MyText)
{
MyAction=&quot;mailto:me@somewhere?Subject=Your Suggestions For Improvement&body=&quot; + MyText
window.location.href = MyAction;
}
</SCRIPT>

<FORM name=&quot;form2&quot; action=&quot;javascript:MailTextarea(form2.textarea2.value)&quot; >
<TEXTAREA name=textarea2 rows=5 ></TEXTAREA><br>
<input type=submit value=&quot;mail !!&quot; name=button2>
</FORM>

Hope this helps,
Erik
<!-- My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !! -->
 
oops,

I forgot a semi-colon after MyText

<SCRIPT language=&quot;JavaScript&quot;>
function MailTextarea(MyText)
{
MyAction=&quot;mailto:me@somewhere?Subject=Your Suggestions For Improvement&body=&quot; + MyText;
window.location.href = MyAction;
}
</SCRIPT>
<!-- My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !! -->
 
Thanks Erik - you're brilliant - works like a charm. Good luck with the Boomerangs...........
Liz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top