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

if a form is "a" then auto write form "b"

Community Beginner ,
May 29, 2016 May 29, 2016

i have 3 dropdown menu forms, form a , b and form c.

form "a" have a dropdown menu with 3 options

1

2

3

if i select 2 the system auto write in form b "red"

if i select 1 the system auto write in form b "green"

if i select 3 the system auto write in form b and form c "green"

any help with this script?

TOPICS
Acrobat SDK and JavaScript
356
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 , May 30, 2016 May 30, 2016

As the custom validation script of the first field enter this code:

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

    this.getField("Dropdown 2").value = "green";

} else if (event.value=="2") {

    this.getField("Dropdown 2").value = "red";

} else if (event.value=="3") {

    this.getField("Dropdown 1").value = "green";

    this.getField("Dropdown 2").value = "green";

} else {

    this.getField("Dropdown 1").value = "";

    this.getField("Dropdown 2").value = "";

}

Translate
LEGEND ,
May 29, 2016 May 29, 2016

You appear to be missing a number of details.

Do the forms exist as a file or do they need to be created?

Are the forms "hidden" in the form and appear as added or new pages in the PDF?

For form A are we writing the "text" into the page or do you mean something else?

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 ,
May 30, 2016 May 30, 2016

Screen Shot 2016-05-30 at 11.19.53.png

if user select 1 then dropdown menu 2 write "green"

if user select 2 then dropdown menu 2 write "red"

if user select 3 then dropdown menu 2  & dropdown menu 3 write "green"

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 ,
May 30, 2016 May 30, 2016

something like this but in adobe dc

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 ,
May 30, 2016 May 30, 2016
LATEST

As the custom validation script of the first field enter this code:

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

    this.getField("Dropdown 2").value = "green";

} else if (event.value=="2") {

    this.getField("Dropdown 2").value = "red";

} else if (event.value=="3") {

    this.getField("Dropdown 1").value = "green";

    this.getField("Dropdown 2").value = "green";

} else {

    this.getField("Dropdown 1").value = "";

    this.getField("Dropdown 2").value = "";

}

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