Hi everyone,
I am using the following script attached to a button on my form:
var cCCAddr = "fsxxxxx@xxx.org; bxxxx@xxxxxx.org";
var cSubLine = "Home leave request-" + Name.rawValue + ", " + country.rawValue + ", " + City.rawValue + "-" + cdsub.rawValue;
var cBody = "Dear Mrs O'XXXX,\n" + " \n"
+ "Please find attached my home leave request for your approval and consideration. \n" + " \n"
+ "Destination: " + country.rawValue + ", " + City.rawValue + " \n" + " \n"
+ "Travellers and dates: "
+ Name.rawValue + " (Staff ) - " + "from: " + Start_Date1.rawValue + " - " + "To: " + End_Date1.rawValue + " - " + "Number of days: " + TotalDays.rawValue + " \n" + " \n"
+ Name1.rawValue + " " + Relationship1.rawValue + " " + Start_Date2.rawValue + " " + End_Date2.rawValue + " \n"
+ Name2.rawValue + " " + Relationship2.rawValue + " " + Start_Date3.rawValue + " " + End_Date3.rawValue + " \n"
+ Name3.rawValue + " " + Relationship3.rawValue + " " + Start_Date4.rawValue + " " + End_Date4.rawValue + " \n"
+ Name4.rawValue + " " + Relationship4.rawValue + " " + Start_Date5.rawValue + " " + End_Date5.rawValue + " \n" + " \n"
+ "The budget line is as follows: " + WBS.rawValue + "\n" + "\n"
+ "Lump Sum : " + Yes.rawValue + "\n" + " \n"
+ "Comments : " + Comments.rawValue + "\n" + "\n"
+ "Kind regards,\n" + "\n"
+ Name.rawValue;
var cEmailURL = "mailto:fXXXXX@XXXX.org?cc=" + cCCAddr + "&subject=" + cSubLine + "&body=" + cBody;
event.target.submitForm({
cURL: cEmailURL,
cSubmitAs:"PDF",
cCharSet:"utf-8"
});
It works great unless nothing is entered into any of the fields (Name1.rawValue, Name2.rawValue, Relationship1.rawValue etc..) Then the email client shows "null".
I t is driving me crazy, i do not much about scripting and have been looking for hours on the internet...with any success, any help would be greatly appreciated..
Sorry for being so wordy. Thank you so much in advance for any assistance.