Show/Hide based on Dropdown selection with Multiple Choices
I have a drop down field with loan transfer types listed. There are 13 different options to choose from. I want to be able to select an option from the list and have an additional field show when that option is selected, but hide when it is not. I need to do this for 4 out of the 13 options - and all text fields are different.
The dropdown field name is "Amount Override" with options for: None, Loan Payment - Suggested Method, Loan Payment if it exceeds amount, 25% of Loan Payment, 50% of Loan Payment, Loan Due Amount, Loan Due Amount if it exceeds amount, Loan Cycle Balance, Loan Cycle Balance if it exceeds amount, Loan Cycle Balance less credits, Loan Cycle Balance less credits if it exceeds amount, Available Balance, Available Balance in excess of amount.
If None is selected from the dropdown then I want my field that is named "None" to show up - otherwise, I want that to be hidden.
If Loan Payment - Suggested Method is selected from the dropdown then I want my field that is named "LoanPayment" to show up - otherwise, I want that to be hidden.
If Loan Cycle Balance is selected from the dropdown then I want my field that is named "LoanCycleBal" to show up - otherwise, I want that to be hidden.
If Loan Payment if it exceeds amount is selected from the dropdown then I want my field that is named "LoanPaymentExceeds" to show up - otherwise, I want that to be hidden
I was using the following javascript, but it is hiding the fields no matter what option is selected.
if(event.value =="None") {
this.getField("None").display = display.visible;
} else {
this.getField("None").display = display.hidden;
}
if(event.value =="Loan Payment – Suggested Method") {
this.getField("LoanPayment").display = display.visible;
} else {
this.getField("LoanPayment").display = display.hidden;
}
if(event.value =="Loan Payment if it exceeds amount") {
this.getField("LoanPaymentExceeds").display = display.visible;
} else {
this.getField("LoanPaymentExceeds").display = display.hidden;
}
if(event.value =="Loan Cycle Balance") {
this.getField("LoanCycleBal").display = display.visible;
} else {
this.getField("LoanCycleBal").display = display.hidden;
}
Can someone please help me with this?