Skip to main content
Known Participant
April 26, 2016
Answered

Drop down list that generates text in a separate text box

  • April 26, 2016
  • 1 reply
  • 1443 views

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

This topic has been closed for replies.
Correct answer try67

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.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
April 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 automatically update when a selection is made in any of those check-boxes.

Known Participant
April 26, 2016

I had to remove the "\n" for a new line. But otherwise, this was perfect!! Thank you!

try67
Community Expert
Community Expert
April 26, 2016

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.