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

Drop down list that generates text in a separate text box

Explorer ,
Apr 26, 2016 Apr 26, 2016

Copy link to clipboard

Copied

Hi everyone.

First off, I don't know if this is even possible, but if anyone can think of a way to make it work, please let me know.

So this is what I am trying to achieve:

  1. Form that has multiple drop down menus.
  2. A user works through the drop down menus selecting topics
  3. Each topic has an export value that is a line of text with that topic
  4. (now this is where I get lost) The export values are then combined into one long line of text and put onto the same pdf into it's own text box.

The goal is that the user can select each of the pertinent topics, and line of text is created, and then the user can copy that text for their use.

Is this possible? If so, does anyone have any idea of how to do something like this?

Thank you,

Michael

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.1K

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

correct answers 1 Correct answer

Community Expert , Apr 26, 2016 Apr 26, 2016

Sure, and it's actually quite easy. Let's say you've set up all of the export values of all of the items in your check-boxes (call them Checkbox1, Checkbox2, etc.), and that you've set up a multi-line text field. You can then use this code as the custom calculation script of that text field:

event.value = this.getField("Checkbox1").value + "\n" + this.getField("Checkbox2").value + "\n" + this.getField("Checkbox3").value + "\n" + this.getField("Checkbox4").value;

And that's it. The value will autom

...

Votes

Translate

Translate
Community Expert ,
Apr 26, 2016 Apr 26, 2016

Copy link to clipboard

Copied

Sure, and it's actually quite easy. Let's say you've set up all of the export values of all of the items in your check-boxes (call them Checkbox1, Checkbox2, etc.), and that you've set up a multi-line text field. You can then use this code as the custom calculation script of that text field:

event.value = this.getField("Checkbox1").value + "\n" + this.getField("Checkbox2").value + "\n" + this.getField("Checkbox3").value + "\n" + this.getField("Checkbox4").value;

And that's it. The value will automatically update when a selection is made in any of those check-boxes.

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
Explorer ,
Apr 26, 2016 Apr 26, 2016

Copy link to clipboard

Copied

I had to remove the "\n" for a new line. But otherwise, this was perfect!! Thank 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 ,
Apr 26, 2016 Apr 26, 2016

Copy link to clipboard

Copied

The "\n" is the new line... If you remove it you'll get the texts added one after another. But if it works for you, that's fine.

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
Explorer ,
Apr 26, 2016 Apr 26, 2016

Copy link to clipboard

Copied

Yeah, I did " " instead of "/n" so that it would add a space between each set of values. What I was wanting was to make a paragraph based on selections, so the new line option wasn't working correctly for this. Again, thank you so much for the help!

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 ,
Apr 26, 2016 Apr 26, 2016

Copy link to clipboard

Copied

That's because it's not "/n", it's "\n"...

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 ,
Apr 26, 2016 Apr 26, 2016

Copy link to clipboard

Copied

And of course, the field has to be set as being Multiline for it to work (under Properties - Options)...

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
Explorer ,
Apr 29, 2016 Apr 29, 2016

Copy link to clipboard

Copied

LATEST

Sorry, that was a typo in my response, and I did set it to multiline. I just didn't want each new sentence from the selection to start on a new line, but tuck behind the previous line. So like I said, I modified the code to put a space between each selection. It worked exactly as I needed. Thank 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