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

List of emails to select from

Community Beginner ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

Can someone please help. I at the end of building my form and I only have one thing left. I would like the end user to select from a list of emails (some or all) from a list arrived from a list of choices for end user to send the form off. I can string a bunch of emails for a submit button, but I need to have the end user to select his/her choice(s) of emails. I tried using the submit email/and even creating a list in list box. I am just looking for the code I can use. I'm sure it is some sort of JavaScript I need thank you.

TOPICS
PDF forms

Views

545

Translate

Translate

Report

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 ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

You can use something like this:

var emails = this.getField("EmailsListBox").value;

if (typeof emails=="object")

    emails = emails.join(";");

else emails = ""+emails;

this.mailDoc({cTo: emails});

Votes

Translate

Translate

Report

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 Beginner ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

Thank you for the quick response; I'm putting my codes in the JavaScript editor and I have something like

​event.target.mailDoc({

  bUI: false,

  cTo:  xfa.resolveNode('form1.#subform.listbox1').rawValue,

  cSubject: "Space A Request",

  cMsg: "Please confirm upon receipt, Thank You."

});

which I know is totally wrong. I apologize for the ignorance. Apart from this one piece, everything else is beautiful on my form. I greatly appreciate you help. I've been looking for a solution now for about two weeks.

​Thank you again.

Votes

Translate

Translate

Report

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 ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

Why are you using that code instead of what I gave you?

Also, is this a LiveCycle Designer form or an Acrobat form?

Votes

Translate

Translate

Report

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 Beginner ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

I'm using an acrobat form. I'm using a government form and everything is complete with the exception my email conundrum. I don't know if I make a script to pick the bases by the ctrl + (mouse up). I included three pics- I hope that may help in my explanation. The bottom line passengers may want to select one, multiple terminals to send this request off to. The click email is great if I just wanted the end user to send it back to one specific user, but that scenario is not at all likely.

I'm genuinely grateful for you help.

Form.JPGExport value.JPGList Box properties.JPG

Votes

Translate

Translate

Report

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 ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

The script I provided will do that, but you need to use it in your Submit button, not as the Mouse Up event of the list box field itself...

Votes

Translate

Translate

Report

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 Beginner ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

I do have a submit button, and I put  your code (minus the numbers .01-.05) them in the "Run a JavaScript". I take it I suppose to type those email addresses in the JavaScript? I just don't know how the List Box and the Submit button will communicate with each other. I posted a couple more photos. Thank you.

Submit Email Button.JPGJava Script.JPG

Votes

Translate

Translate

Report

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 ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

I had understood from your question that the list box contains email addresses, or at least items with email addresses as their export values. If that's not the case the script is not going to work...

Votes

Translate

Translate

Report

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 Beginner ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

Yes I have the addresses in the export value, and in the image that is the code I used to get to my export value. The properties for the list box does not have a format tab like the dropdown box has, so I put it in the script. I know that script is correct for my drop down boxes are working perfectly. I just don't know what tab to put the code in, and if I suppose to add address in the code. Thank you.

List Box output value.JPG

Votes

Translate

Translate

Report

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 ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

The code should not go under the list-box, as I said, but under the Submit button. And if you use this code you should not include a separate Submit Form command. The script does it all for you.

Votes

Translate

Translate

Report

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 ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

It might be easier if you could share the actual file (via Dropbox, Google Drive, etc.)...

Votes

Translate

Translate

Report

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 Beginner ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

We have a lot of elderly people who would be using this form, so I'm hoping I can keep this to one single place. Okay I have the list box and now there is no codes in the button properties for that. All my codes now are with the submit email button. illustrated below. I added these photos to it. I'm not sure if I need to have a Mailto: "email" option has shown in the first image. I have more words in-between the photos. Thank you for your patience- this thing is driving me mad!

Submit Email Button.JPG

For the submit form do I need to put anything in the email option Mailto:??  I know I can put an address for a specific recipient, but obviously I'm looking for a list. The image is illustrated below Do I have to have something in here if I'm going to use the first code you provided. 

mail to.JPG

For the JavaScript, this is the code I have inputted into the JavaScript editor, see below:

Actions run Java Script.JPG

Finally the code I put is indicated below:

JavaScript editor.JPG

Votes

Translate

Translate

Report

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 Beginner ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

I got rid of the submit command under the click to email button since I don't need it due to the JavaScript.

Votes

Translate

Translate

Report

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 Beginner ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

LATEST

I got it thank you!  It wasn't that  bad after all.

Votes

Translate

Translate

Report

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