Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Multiple Checkbox selections to populate email address

New Here ,
Apr 12, 2016 Apr 12, 2016

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!! 

TOPICS
Acrobat SDK and JavaScript , Windows
647
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2016 Apr 12, 2016

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 12, 2016 Apr 12, 2016

Thanks try67, this is coming up with a

TypeError: this.getHield(fields is null

9: Field: Mouse Up

Any suggestions? Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2016 Apr 13, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 17, 2016 Apr 17, 2016
LATEST

Thank you very much.  That is brilliant.  Its usually something that simple!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines