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

Drop-down list: same data is showing in all field

Participant ,
Feb 26, 2018 Feb 26, 2018

I made a query form in adobe acrobat pro. In this form there is one dropdown box "Area". There are another 5 dropdown question box, "Q1","Q2","Q3","Q4","Q5". What I am trying to do, If I select Grant/Coat in "Area" field all the questions (e.g. A,B,C,D)/(X,Y,Z) will be available in "Q1","Q2","Q3","Q4"and"Q5" field and I will be able to select any question from the dropdown list.

I tried below code but it did not worked,

switch (event.value) {

    case "Grant":

        this.getField("Q1").setItems(["A","B","C","D"]);

        break;

     case "Grant":

        this.getField("Q2").setItems(["A","B","C","D"]);

        break;

    case "Grant":

        this.getField("Q3").setItems(["A","B","C","D"]);

        break;

   case "Coat":

        this.getField("Q1").setItems(["X","Y","Z"]);

        break;

   case "Coat":

        this.getField("Q2").setItems(["X","Y","Z"]);

        break;

   case "Coat":

        this.getField("Q3").setItems(["X","Y","Z"]);

        break;

}

Then I tried below code, but this time if I change one dropdown box other boxes are automatically changed to same text.

switch (event.value) {

    case "- Select One -":

        this.getField("Q").setItems(["-----"]);

        break;

    case "Grant":

        this.getField("Q").setItems(["A","B","C","D"]);

        break;

    case "Coat":

        this.getField("Q").setItems(["X","Y","Z"]);

        break;

}

Similar thing happens when I select Coat in dropdown box.

Any help would be great.

TOPICS
PDF forms
3.3K
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
1 ACCEPTED SOLUTION
Community Expert ,
Feb 26, 2018 Feb 26, 2018

Try this:

switch (event.value) {

    case "Grant":

        this.getField("Q1").setItems(["A","B","C","D"]);

        this.getField("Q2").setItems(["A","B","C","D"]);

        this.getField("Q3").setItems(["A","B","C","D"]);

        break;

   case "Coat":

        this.getField("Q1").setItems(["X","Y","Z"]);

        this.getField("Q2").setItems(["X","Y","Z"]);

        this.getField("Q3").setItems(["X","Y","Z"]);

        break;

}

View solution in original post

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 ,
Feb 26, 2018 Feb 26, 2018

Try this:

switch (event.value) {

    case "Grant":

        this.getField("Q1").setItems(["A","B","C","D"]);

        this.getField("Q2").setItems(["A","B","C","D"]);

        this.getField("Q3").setItems(["A","B","C","D"]);

        break;

   case "Coat":

        this.getField("Q1").setItems(["X","Y","Z"]);

        this.getField("Q2").setItems(["X","Y","Z"]);

        this.getField("Q3").setItems(["X","Y","Z"]);

        break;

}

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
Participant ,
Feb 26, 2018 Feb 26, 2018

Thanks Bernd A. for the reply.

I already tried as suggested but it is not working.

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 ,
Feb 26, 2018 Feb 26, 2018

What is not working?

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
Participant ,
Feb 26, 2018 Feb 26, 2018

Hi Bernd A.

I put the code but nothing is showing when I click in the dropdown icon of "Q1" or "Q2" or "Q3" Fields.

Thanks

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 ,
Feb 26, 2018 Feb 26, 2018

You should share the form.

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
LEGEND ,
Feb 26, 2018 Feb 26, 2018

You didn't say where that script is placed. What field (Area?) and what event (Keystroke, Validate, etc.)?

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
Participant ,
Feb 26, 2018 Feb 26, 2018

Hi George J

I put the code in custom validation script of "Area" field.

Thanks

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
Participant ,
Feb 26, 2018 Feb 26, 2018
LATEST

I just click commit selected value immediately in Area field and worked perfectly.

Thanks for the help

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