/    Sign up×
Community /Pin to ProfileBookmark

form Details to Email

Ok so i have this script that i have written out that when the user fills out all of the forms and they push the email button it opens up a blank outlook email and it copies all the form information into the email and all they have to do is it send but for some reason when i hit the email button all of my forms are mashed together on the same line and I need each individual form on there on line. here is what im using Any help would be great i have looked everywhere to fix this and i have tried rewriting it as well, but no luck

[CODE]<SCRIPT LANGUAGE=”JavaScript”>

function updateDescription (frm)
{
var currentdate = new Date()
var Template = “”;
var vald=””;
var frm = document.getElementsByTagName(“form”)[0];

if (window.event.srcElement == frm.emailform){
core= “”
}

else

core = “”

Template += “VOIP #: ” + frm.voipex8.value + core;
Template += “Time (US EST) The Caller May Be Contacted: ” + frm.time1.value + core;
Template += “CSC Backup POC in US #: ” + frm.poc1.value + core;
Template += “Time CSC Back up in US May Be Contacted: ” + frm.time2.value + core;
Template += “Environment: ” + frm.Enviroment1.value + core;
Template += “Affected Machine Name: ” + frm.Affected1.value + core;
Template += “Machine IP Address: ” + frm.machineipex8.value + core;
Template += “Machine OS: ” + frm.machineosex8.value + core;
Template += “User ID: ” + frm.useridex8.value + core;
Template += “Application User ID: ” + frm.appuseridex8.value + core;
Template += “Machine Location: ” + frm.machinelocex8.value + core;
Template += “Mainframe LPAR: ” + frm.mainframeex8.value + core;
Template += “Application(s) Affected: ” + frm.applicationex8.value + core;
Template += “Urgency: ” + frm.sev1.value + core;
Template += “Impact: ” + frm.sev2.value + core;
Template += “Severity: ” + frm.sevex8.value + core;
Template += “Assignment Group: ” + frm.assigngrpex8.value + core;
Template += “Description of the Issue: ” + frm.Descript1.value + core;

if (window.event.srcElement == frm.emailform){
//this creates the email, it is up to the sender to hit send
var eml=””;
var bod=”&body=”+escape(Template);
var subj=”?subject=Email Request”;
location.href=”mailto:”+eml+subj+bod;
}

if (window.event.srcElement == frm.copyform){

frm.holdtext.value = Template;
Copied=frm.holdtext.createTextRange();
Copied.execCommand(‘copy’);
alert(‘Template copied! Paste (CTRL+V or right click and paste) into long description of Service Center ticket’);
}
}

</SCRIPT>[/CODE]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@FairviewJul 20.2011 — To insert a line break, use, "&#37;0D%0A":

[CODE]nBody += "City: " + nForm['city'].value +"%0D%0A";
nBody += "State: " + nForm['state'].value +"%0D%0A";[/CODE]
Copy linkTweet thisAlerts:
@dslegendsauthorJul 20.2011 — Ive tried this and all it does is post %0D%0A after each word such as VOIP%0D%0A it looks like that
Copy linkTweet thisAlerts:
@dslegendsauthorJul 20.2011 — scratch my last post i needed to add a n into the core = " "
×

Success!

Help @dslegends spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...