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

Newby! Auto populate text field with statement by selecting drop-down menu

Community Beginner ,
Nov 07, 2017 Nov 07, 2017

I am currently trying to create a form within PDF it will allow the user to select from the drop-down menu and based on the selection will auto populate a text field with a statement.  I would also like the user to be able to edit the statement‘ Once it has been auto-populated.

My drop-down menu “Shipdec2”

My text field “statdec1”

I would be grateful if you can assist.

I am a beginner in adobe

TOPICS
Acrobat SDK and JavaScript
1.7K
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

correct answers 1 Correct answer

Community Expert , Nov 08, 2017 Nov 08, 2017

You can use something like this code as the custom validation script of the drop-down field:

if (event.value == "Option 1") this.getField("statdec1").value = "Text for option 1";

else if (event.value == "Option 2") this.getField("statdec1").value = "Text for option 2";

else if (event.value == "Option 3") this.getField("statdec1").value = "Text for option 3";

etc.

Just make sure you tick the option to commit the selected value immediately (under the drop-down's Properties, Options tab), so the text fi

...
Translate
Community Expert ,
Nov 08, 2017 Nov 08, 2017

You can use something like this code as the custom validation script of the drop-down field:

if (event.value == "Option 1") this.getField("statdec1").value = "Text for option 1";

else if (event.value == "Option 2") this.getField("statdec1").value = "Text for option 2";

else if (event.value == "Option 3") this.getField("statdec1").value = "Text for option 3";

etc.

Just make sure you tick the option to commit the selected value immediately (under the drop-down's Properties, Options tab), so the text field will update as soon as you make a selection.

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 Beginner ,
Nov 08, 2017 Nov 08, 2017

Is there anything I need to put into the text box field ”statdec1”?

Also, will this allow the user to edit the statement that has been auto populated into “statdec1”?

Appreciate your time! I’m most grateful!

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 ,
Nov 08, 2017 Nov 08, 2017

- No.

- Yes.

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 Beginner ,
Nov 08, 2017 Nov 08, 2017

Is there anything I need to add to the end of the script, like a bracket?

appreciate your assistance!

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 Beginner ,
Nov 08, 2017 Nov 08, 2017

This worked beautifully. Thank you!

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
Explorer ,
Oct 25, 2021 Oct 25, 2021

Hello,

Sorry I am very new at this!

I can get the drop down box to change the text box to the specified text. How do I make the drop down box insert different information in other text boxes at the same time?

 

Thank You

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 ,
Oct 25, 2021 Oct 25, 2021

Put all fields in curly brackets, like this:

if (event.value == "Option 1") {

this.getField("field1").value = "Text for option 1";

this.getField("field2").value = "Text for option 1";

this.getField("field3").value = "Text for option 1";}

 

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
Explorer ,
Oct 25, 2021 Oct 25, 2021
LATEST

Thankyou

That has worked perfectly!

Much appreciated! 

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