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

Combining Javascipt Variables and inserting into e-mail

Status
Not open for further replies.

ABinBoston

Programmer
Nov 6, 2001
22
US
I use the function below to open Outlook and populate the Outlook form with a subject, to and the body. I'd like to combine several form elements in the body.. such as

date
time
issue
assigned by and others with a new line for each field.
I have tried many combinations in ordr to combine the text with no luck.

any help is appreciated

AB


<script>
function sendmail()
{
x_Subject =document.emailform.subject.value;
x_Body =document.emailform.body.value;
x_Assignee = document.emailform.email.value;
self.location=&quot;mailto:&quot; + document.emailform.email.value + &quot;?subject=&quot;+x_Subject+&quot;&body=&quot;+x_Body;


}
</script>
 
Have you tried the following:


<script>
function sendmail()
{
x_Subject =document.emailform.subject.value;
x_Body =document.emailform.body.value;
x_Body += &quot;Date = &quot; + Date();
x_Assignee = document.emailform.email.value;
self.location=&quot;mailto:&quot; + document.emailform.email.value + &quot;?subject=&quot;+x_Subject+&quot;&body=&quot;+x_Body;


}
</script>

I wasn't sure if you were asking how to add a date function, or how to add content to the existing &quot;x_Body&quot; string.

-Scott

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top