Skip to main content
Participant
May 6, 2016
Question

Hiding fields when drop down selected

  • May 6, 2016
  • 1 reply
  • 302 views

Hi

I have a drop down box with 3 choices - Telephone/Writing/Not applicable

If telephone chosen I want "text8" field box to show
If Writing "test7" to show

if Not applicable chosen - I want neither box to show....


This below isn’t working  - when I select "not applicable" I still get the “text 8”
box displaying (but not the “Text7” box) (I am brand new to this) – what is wrong
please!!

Thanks

if (event.value == "Not applicable")

{

this.getField("Text8").display
= display.hidden;

this.getField("Text7").display =
display.hidden;

}

else if (event.value == "Telephone")

{

this.getField("Text8").display =
display.visible;

this.getField("Text7").display =
display.hidden;

}

else if (event.value == "Writing")

{

this.getField("Text7").display =
display.visible;

this.getField("Text8").display =
display.hidden;

}

This topic has been closed for replies.

1 reply

Inspiring
May 6, 2016

You need to use the exact field names. In your post, you used "Text7", "test7", and "text 8", "text8", and "Text8", so I suspect there's a typo in your code.

Participant
May 6, 2016

No typo in code just in my explanation! sorry

Inspiring
May 6, 2016

Check the JavaScript console by pressing Ctrl+J to see if any errors are reported.