Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Hide Field when selection of drop down

New Here ,
Feb 11, 2025 Feb 11, 2025

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.
TOPICS
JavaScript , PDF , PDF forms
234
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Feb 11, 2025 Feb 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;

 

 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 11, 2025 Feb 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;

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 11, 2025 Feb 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 11, 2025 Feb 11, 2025

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 11, 2025 Feb 11, 2025
LATEST

that worked! thank you so much! you are a lifesaver! 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines