Copy link to clipboard
Copied
Hi Everyone
I have a Acrobat Pro fillable form which has a submit email button. There are 4 checkboxes, named Checkbox101, Checkbox102, Checkbox103 and Checkbox104 which each have export values of unique email addresses. I would like to be able to select more than one of these checkboxes to automatically populate the To fields of an email. I am hoping to have all the address go into the one email also, not, one email for each address. The CC field is to be filled with two constant email address which do not change.
For the life of me I have not been able to get this to work after looking at other discussions.
I'm hoping someone might be able to help me out with this one. Thanks in advance!!
Copy link to clipboard
Copied
You can do it using this code:
var fields = ["Checkbox101", "Checkbox102", "Checkbox103", "Checkbox104"];
var addresses = [];
for (var i in fields) {
var v = this.getField(fields).valueAsString;
if (v!="Off") addresses.push(v);
}
this.mailDoc({cTo: addresses.join(";"), cCc: "fixed1@server.com;fixed2@server.com", cSubject: "Subject line goes here"});
Copy link to clipboard
Copied
Thanks try67, this is coming up with a
TypeError: this.getHield(fields is null
9: Field: Mouse Up
Any suggestions? Thanks!
Copy link to clipboard
Copied
That means one of the field names is incorrect. Double-check them, and make sure that they appear in the script EXACTLY as they do in the Properties of your fields, including any spaces, upper/lower case letters, special characters, etc.
Copy link to clipboard
Copied
Thank you very much. That is brilliant. Its usually something that simple!!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now