Skip to main content
New Participant
February 11, 2025
Answered

Hide Field when selection of drop down

  • February 11, 2025
  • 1 reply
  • 490 views

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.
Correct answer Nesa Nurani

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;

 

 

1 reply

Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
February 11, 2025

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;

 

 

New Participant
February 11, 2025
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
Nesa Nurani
Community Expert
February 11, 2025

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