Copy link to clipboard
Copied
Happy Friday!
I'm creating a form using Adobe Acrobat Pro DC (32-bit) and am struggling with the following:
Creating a method in which there are five possible emails the form can be submitted to. Each email respresents a division within my department.
I would like users of the form to be able to select any number of emails to send the form to, from one division to all.
Is there javascript I can use to make this happen? I'm well aware of how to use the submit form button + mailto:adobe@adobe.com but what about multiple selections?
Thank you so much 🙂
Copy link to clipboard
Copied
Create 5 check-boxes, one for each department, and set the email address as their export values. Say they are called Dept1 to Dept5.
Then you can use the following script to submit the form to the selected departments:
var emails = [];
for (var i=1; i<=5; i++) {
var v = this.getField("Dept"+i).valueAsString;
if (v!="Off") emails.push(v);
}
if (emails.length==0) app.alert("You must select at least one department.");
else this.mailDoc({cTo: emails.join(";"), cSubject: "Email subject goes here", cMsg: "Email message goes here"})
Find more inspiration, events, and resources on the new Adobe Community
Explore Now