Skip to main content
Participant
Feb 11, 2025 3:25 PM UTC
Answered

Hide Field when selection of drop down

I am currently working on an account form.

 

I have one drop down called Options with selections "Add" , "Transfer", and "Existing".

 

I have two separate text fields "Add" and "Transfer".

 

For the "Add" selection, I want "Add" field to show only.

for the "Transfer" selection, I only want "Transfer" to show.

 

I used script for Transfer field and it works.

if(this.getField("Dropdown3").value == "Add Funds"){
event.target.display = display.visible;
}
else{
event.target.display = display.hidden;
}
 
I tried to the same script with the add field, but both fields remain hidden when I select "Add" in the drop down.   Please help.
Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
Feb 11, 2025 3:40 PM UTC

Is your choice "Add" or "Add Funds"?
Use this as calculate script of dropdown:

 

this.getField("Add").display = (event.value == "Add") ? display.visible : display.hidden;
this.getField("Transfer").display = (event.value == "Transfer") ? display.visible : display.hidden;

 

 

4 replies

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
Feb 11, 2025 3:40 PM UTC

Is your choice "Add" or "Add Funds"?
Use this as calculate script of dropdown:

 

this.getField("Add").display = (event.value == "Add") ? display.visible : display.hidden;
this.getField("Transfer").display = (event.value == "Transfer") ? display.visible : display.hidden;

 

 

Translate
Participant
Feb 11, 2025 4:30 PM UTC
Good morning,

Options is the drop down and add funds is the option (I had just shortened
it to Add). There is a field called Add Funds where they can also put it
the money amount.

Kind Regards,

Jessica Schaeffer
Translate
Nesa Nurani
Community Expert
Community Expert
Feb 11, 2025 4:45 PM UTC

Just change in my script to correct field names and choices.

Translate