Copy link to clipboard
Copied
I have four dropdown menus. "Name", "Title", "Competency", "Number". What I want to do is to have the values in the last three to change based on which "Name" I select. I have tried just about every code and script I could find but doesn't seem to work with the newest version of Acrobat Pro DC. Thank you.
Copy link to clipboard
Copied
As 'validation' script of "Name" field use this:
var d1 = this.getField("Title");
var d2 = this.getField("Competency");
var d3 = this.getField("Number");
if(event.value == "Name 1"){
d1.setItems(["Title1","Title2"]);
d2.setItems(["Competency1","Competency2"]);
d3.setItems(["Number1","Number2"]);}
else if(event.value == "Name 2"){
d1.setItems(["Title3","Title4"]);
d2.setItems(["Competency3","Competency4"]);
d3.setItems(["Number3","Number4"]);}
else{
d1.clearItems();
d2.clearItems();
d3.clearItems();}
Just change items to what you need them to be and add more 'else if' conditions (before last 'else') if needed.
Copy link to clipboard
Copied
https://acrobatusers.com/tutorials/js_list_combo_livecycle/
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
I'm sorry, but none of that makes any sense. Can you please explain in Crayon? I need this dumbed down... a lot.
Copy link to clipboard
Copied
As 'validation' script of "Name" field use this:
var d1 = this.getField("Title");
var d2 = this.getField("Competency");
var d3 = this.getField("Number");
if(event.value == "Name 1"){
d1.setItems(["Title1","Title2"]);
d2.setItems(["Competency1","Competency2"]);
d3.setItems(["Number1","Number2"]);}
else if(event.value == "Name 2"){
d1.setItems(["Title3","Title4"]);
d2.setItems(["Competency3","Competency4"]);
d3.setItems(["Number3","Number4"]);}
else{
d1.clearItems();
d2.clearItems();
d3.clearItems();}
Just change items to what you need them to be and add more 'else if' conditions (before last 'else') if needed.
Copy link to clipboard
Copied
So, I put this in the custom validation script in the "Name" dropdown. Do I put the actual name in the script, and the "Title" I want associated with it, so on, etc.? I am really bad at this. Nothing is working.
Copy link to clipboard
Copied
I figured it out. My dropdown titles didn't match the code. All good now. Thank you so much.
Copy link to clipboard
Copied
I want the same effect for the dropdown menu but I don't work.
I got two dropdown called "d" and "e" which both of them contain three options in it.
And I want to show the "e" option based on the options in "d" menu
Copy link to clipboard
Copied
It also doesn't work if I use this script
 
Copy link to clipboard
Copied
In the first photo, you are missing the second curly bracket at the 'else' part.
In the second photo, you are missing the quote at 'Item 3'.
Copy link to clipboard
Copied
It also doesn't work. Can you do the corrections for me?
that When I select option "a" on drop down list called "drop1", another drop down list "drop2" will automatically appear option "b".
There are three options in each dropdown
Copy link to clipboard
Copied
Use this as validation script of "drop1" field:
var d2 = this.getField("drop2");
if(event.value == "a")
d2.setItems(["a1"]);
else if(event.value == "b")
d2.setItems(["b1"]);
else if(event.value == "c")
d2.setItems(["c1"]);
else
d2.clearItems();
Copy link to clipboard
Copied
I have applied this.
However, after I select from drop1, all the options from drop2 are disappeared
Copy link to clipboard
Copied
 
Copy link to clipboard
Copied
Is field name "e" or "drop2"?
Can you share file?
Copy link to clipboard
Copied
  
Copy link to clipboard
Copied
What is the issue exactly?
Did you use script as validation or calculation?
Copy link to clipboard
Copied
  
after I select from the left dropdown, the options of right drop down disappeared.
 
Copy link to clipboard
Copied
Use script as 'Validate'.
Copy link to clipboard
Copied
 I applied here
Copy link to clipboard
Copied
Then please share your file with us.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Try the atachment.
Copy link to clipboard
Copied
Tick the box that says "Commit selected value immediately" (under Properties - Options) and it will change as soon as you make a selection in the first field.
Copy link to clipboard
Copied

