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

Poplulate fields from dropdown box

New Here ,
Jan 20, 2017 Jan 20, 2017

I have a dropdown box with 3  possible answers and I want to populate other fields with data depending on the answers to the dropdown box.

So there are 3 possible  answers: and 3 possible data entries into fields.

Can someone give me a clue as how to start this script

TOPICS
Acrobat SDK and JavaScript , Windows
510
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 , Jan 20, 2017 Jan 20, 2017

You can use something like this as the drop-down's custom validation script:

if (event.value == "Option 1") {
     this.getField("Text1").value = "Some text";

     this.getField("Text2").value = "John";

     this.getField("Text3").value = "Doe";
} else if (event.value == "Option 2") {
     this.getField("Text1").value = "Some other text";

     this.getField("Text2").value = "Michael";

     this.getField("Text3").value = "Scott";

}

etc.

Edit: fixed an error in the code...

Translate
Community Expert ,
Jan 20, 2017 Jan 20, 2017

You can use something like this as the drop-down's custom validation script:

if (event.value == "Option 1") {
     this.getField("Text1").value = "Some text";

     this.getField("Text2").value = "John";

     this.getField("Text3").value = "Doe";
} else if (event.value == "Option 2") {
     this.getField("Text1").value = "Some other text";

     this.getField("Text2").value = "Michael";

     this.getField("Text3").value = "Scott";

}

etc.

Edit: fixed an error in the code...

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
New Here ,
Jan 23, 2017 Jan 23, 2017
LATEST

Cheers try67,

Have sorted it out

Regards

Stef

Sent from Outlook<http://aka.ms/weboutlook>

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