Skip to main content
Participant
August 27, 2021
Question

Multiple Email Submissions for Form

  • August 27, 2021
  • 1 reply
  • 360 views

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 🙂

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 27, 2021

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"})