Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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;
}
Copy link to clipboard
Copied
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;
}
Copy link to clipboard
Copied
Thanks Bernd A. for the reply.
I already tried as suggested but it is not working.
Copy link to clipboard
Copied
What is not working?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
You should share the form.
Copy link to clipboard
Copied
You didn't say where that script is placed. What field (Area?) and what event (Keystroke, Validate, etc.)?
Copy link to clipboard
Copied
Hi George J
I put the code in custom validation script of "Area" field.
Thanks
Copy link to clipboard
Copied
I just click commit selected value immediately in Area field and worked perfectly.
Thanks for the help

