Copy link to clipboard
Copied
I would like to to pull a name from a form field on my forms and place it where (add name from a form field here) in the script below. The script works perfectly as is, I would just like to add the name to each section. Can someone please help? Thanks
this.mailDoc({ cTo: "joeblow@myemail.com",
cSubject: "My Form for (add NAME from a form field here)",cMsg: "Please see the attached form in reference to (add NAME from a form field here) ."
});
Copy link to clipboard
Copied
Try this:
var str1 = this.getField("FirstName").valueAsString;
var str2 = this.getField("MiddleName").valueAsString;
var str3 = this.getField("LastName").valueAsString;
var sMsg = "Please see the attached Inquest Summary Report/Autopsy Authorization in reference to the death of " + str1 + " " + str2 + " " + str3 + ". If you have any questions, please feel free to contact my office. Thank you!"
var sSubject = "My Form";
this.mailDoc({ cTo: "joeblow@myemail.com", cSubject: sSubject ,cMsg: sMsg});
PDF Acrobatic, InDesigner & Photoshoptographer
Copy link to clipboard
Copied
Try this, after adjusting the field name:
var sName = this.getField("name").valueAsString;
var sSubject = "My Form for " + sName;
var sMsg = "Please see the attached form in reference to " + sName + ".";
this.mailDoc({ cTo: "joeblow@myemail.com", cSubject: sSubject ,cMsg: sMsg});
PDF Acrobatic, InDesigner & Photoshoptographer
Copy link to clipboard
Copied
Thanks for your reply. I entered the code and replaced "name" with my form field name but nothing happened.
Copy link to clipboard
Copied
I need help with JavaScript I created a form and when the user hits the submit button I need the JavaScript to ask if no email for where if no email form where
Copy link to clipboard
Copied
1. Where exactly did you enter this code, and how did you run it?
2. Was there anything in the JavaScript console?
Copy link to clipboard
Copied
I entered the code in the action tab with javascript.
Copy link to clipboard
Copied
And... question 2 please.
Copy link to clipboard
Copied
I appologize, but I'm still learning about javascript and not sure how to access javascript console.
Copy link to clipboard
Copied
This was in the console
Copy link to clipboard
Copied
The Console says your made a typo in the field's name.
JavaScript is case sensitive.
PDF Acrobatic, InDesigner & Photoshoptographer
Copy link to clipboard
Copied
Thank you for your response. I will see if that works
Copy link to clipboard
Copied
I double checked the spelling of the form field name and still getting the same response in the console. It's still not recognizing the form field name. Thanks for any help with this.
Copy link to clipboard
Copied
This is the javascript that I would actually like to have if you could help me figure out how to pull the First, Middle, and Last name from the form fields in the pdf form. Each name has it's own field and are titled (FirstName) (MiddleName) (LastName). For some reason, the script will not recogzine the field name. This script works perfectly except it will not pull the fields into the message. Thank you!
this.mailDoc({ cTo: "joeblow@myemail.com",
cSubject: "Justice of the Peace Inquest Summary Report/Autopsy Authorization",cMsg: "Please see the attached Inquest Summary Report/Autopsy Authorization in reference to the death of (First Name) (MiddleName) (LastName). If you have any questions, please feel free to contact my office. Thank you!"
});
Copy link to clipboard
Copied
Try this:
var str1 = this.getField("FirstName").valueAsString;
var str2 = this.getField("MiddleName").valueAsString;
var str3 = this.getField("LastName").valueAsString;
var sMsg = "Please see the attached Inquest Summary Report/Autopsy Authorization in reference to the death of " + str1 + " " + str2 + " " + str3 + ". If you have any questions, please feel free to contact my office. Thank you!"
var sSubject = "My Form";
this.mailDoc({ cTo: "joeblow@myemail.com", cSubject: sSubject ,cMsg: sMsg});
PDF Acrobatic, InDesigner & Photoshoptographer
Copy link to clipboard
Copied
Thank you for your response again. For some reason it will not pull the form fields into the email. I have the fields labeled exactly like in the code.
Copy link to clipboard
Copied
And the console has no errors.
Copy link to clipboard
Copied
Thank you so much for your help. I was able to get this to work perfectly. I found that I was leaving out a space in the field name. I'm clueless. Thanks again.
Copy link to clipboard
Copied
Is there a code to use after the email body to skip a line and add the email signature to the body after "Thank you!" as indicated below? Thank you for any help.
var str1 = this.getField("FirstName").valueAsString;
var str2 = this.getField("MiddleName").valueAsString;
var str3 = this.getField("LastName").valueAsString;
var sMsg = "Please see the attached Inquest Summary Report/Autopsy Authorization in reference to the death of " + str1 + " " + str2 + " " + str3 + ". If you have any questions, please feel free to contact my office. Thank you!"
var sSubject = "My Form";
this.mailDoc({ cTo: "joeblow@myemail.com", cSubject: sSubject ,cMsg: sMsg});
Copy link to clipboard
Copied
I would like for the signature to look like this.
Charles Brewer
[PERSONAL INFORMATION REMOVED BY MODERATOR - THIS IS AN OPEN FORUM NOT ADOBE SUPPORT, PLEASE DO NOT POST PERSONAL INFORMATION]

