Dropdown box selection affecting other dropdown box selections
Hi all. I'm relatively new to the whole JavaScript in Adobe Acrobat thing so I'll try to be as concise as possible.
Simply put, I have created a dropdown menu named "Banklist" with 2 options "Bank 1" and "Bank 2".
- When "Bank 1" is selected a second dropdown (named "MCCCODES") appears beside it with a number of codes which based off of the code selection will populate a field with a specific percentage.
- If "Bank 2" is selected the second dropdown remains hidden.
I used the following Validation script and everything works as I had hoped:
if(event.value =="Bank 1"){
this.getField("MCCCODE").display = display.visible;
this.getField("Test1").display = display.visible;
}
else{
this.getField("MCCCODE").display=display.hidden;
this.getField("Test1").display=display.hidden;
}
if(event.value =="Bank 2"){
this.getField("Text5test").display = display.visible;
}
else{
this.getField("Text5test").display=display.hidden;
}
My problem is that if I click on a dropdown in an unrelated area of the form (named Combo Box01 for example), as soon as I select an option it automatically causes "Bank 1" to appear and the second hidden box appears as well. Does anyone have any ideas as to what is causing unrelated dropdowns to affect each other?
I'm sure I'm missing something simple but for the life of me I can not think of what it is.
Thank you in advance for all your help. This is driving me crazy!
