Adobe Form JavaScript
- July 7, 2025
- 1 reply
- 871 views
I'd like to use the "Submit" button I created to run a Javascript that will compose an email with the following form fields pulled in and attach the completed form as a PDF.
To - Field Name "All submissions automatically sent to"
CC - Field Names "Email of Staff Submitting Form"; "Email of First Approver"; "Email of Second Approver"
Subject - Field Name "Start Date" + Field Name "Legal Name"
Body - Attached please find the hiring authorization form, pending approval, for Field Name "Legal Name".
Additionally, I'd like to form to attach with a new title: Hiring Authorization Form - Field Name "Legal Name".
Below is the start to the Javascript I attempted to use, but it is not opening an email when I hit submit.
var cTo = this.getField ("All submissions automatically sent to").value;
var cCc = this.getField ("Email of Staff Submitting Form").value + this.getField("Email of First Approver").value + this.getField("Email of Second Approver");
var cSubject = this.getField ("Start Date").value + this.getField("Legal Name").value;
var cBody = "Attached please find the hiring authorization form, pending approval, for " + this.getField("Legal Name").value;
event.target.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: cSubLine, cMsg: cBody});
I'm hopeful someone might be able to see where I went wrong, or tell me what script I should be using!
Thank you.
