Create a dynamic dropdown field in Adobe Acrobat Pro XI
Hello all. I am trying to create a field in one of my forms using Adobe Acrobat Pro XI. I have a dropdown list of "main" items, and based on what is selected in that list, I want a second dropdown list to give different choices. I have searched and searched and have javascript that I thought might work, but maybe I am have a mistake or I am placing the javascript in the wrong place, becasue it is not working. I know very, very little about javascript, so any help would be so much appreciated.
I am using Adobe Acrobat Pro XI. I added a "new field", and selected "dropdown". The field name is ProvType. The dropdown options are:
Inpatient
Outpatient
Physician
I have the "Commit selected value immediately" selected.The field is not validated. The format is "none." There are no actions or calculations associated with it.
I then created another dropbox, and named it SubProvType. Under Actions, I selected the trigger as Mouse Up, and then selected the Action "Run a JavaScript." I selected the add button, and typed this in the JavaScript editor:
switch (ProvType.rawValue)
{
case "Inpatient":
this.setItems("Hospice,Hospital,Nursing Facility");
break;
case "Outpatient":
this.setItems("Adult Day Center,Home,Other");
break;
case "Physician":
this.setItems("Surgeon,Family Practice,Neurologist");
break;
}
What I want to happen is:
If "Inpatient" is selected, I want the following options to be available in the second dropdown box "SubProvType":
Hospice
Hospital
Nursing Facility
If "Outpatient" is selected, I want the following options to be available in the second dropdown box "SubProvType":
Adult Day Center
Home
Other
If "Physician" is selected, I want the following options to be available in the second dropdown box "SubProvType":
Surgeon
Family Practice
Neurologist
However.... when I close the form editing and try to select a different option in the ProvType field, the SubProvType field remains blank and there are no options available. There are also no errors.
I must be missing something, but I have no idea where to start. Thank you in advance for any help anyone can provide.
