Skip to main content
sarahp26444118
Participating Frequently
September 28, 2017
Answered

Creating a form that can populate a text field from a dropdown selection

  • September 28, 2017
  • 1 reply
  • 3288 views

I have created a from in Acrobat Pro Dc that is a report. I have a dropdown list called "speaking and listening" that I want to populate a text field field called "comment". I want the form to be able to make a selection from the list then add a sentence to the text field. The possible selections are:

Outstanding

High

Sound

Basic

Limited

I want there to be a different sentence for each selection. If have tried a few scripts but haven't been able to get any to work correctly.

I am hoping someone might be able to help.

Thank you

This topic has been closed for replies.
Correct answer JR Boulay

See this great (and free) sample, data and JavaScript are all in the dropdown :

http://abracadabrapdf.net/parking/AcroUsers/Populate-text-field-from-dropdown.pdf

1 reply

try67
Community Expert
Community Expert
September 28, 2017

You say you want to "add a sentence to the text field". Do you mean that you want to keep whatever value it already has and the new sentence to it, or do you actually mean that you want to set the field's value to be that sentence?
Also, should the text field be editable by the user, or should its value only be determined by the value of the drop-down field?

sarahp26444118
Participating Frequently
September 28, 2017

I mean I want the selection to stay in the drop down then a seperate sentence to appear in the text field.

E.g if sound is selected in the drop down the the text field would show "indicator for sound knowledge". Then if you selected high the text field would show "indicator for high knowledge" etc

the field would be blank so the sentence would become the fields value, I think.  I want the text field to be editable too in case minor changes need to be made.

Thank you for replying

try67
Community Expert
Community Expert
September 28, 2017

OK. As the custom validation script of the drop-down you can use something like this, then:

if (event.value=="Sound") this.getField("Text1").value = "indicator for high knowledge"; // etc.