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

Hiding fields when drop down selected

New Here ,
May 06, 2016 May 06, 2016

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;

}

TOPICS
Acrobat SDK and JavaScript , Windows
242
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
LEGEND ,
May 06, 2016 May 06, 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.

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 ,
May 06, 2016 May 06, 2016

No typo in code just in my explanation! sorry

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
LEGEND ,
May 06, 2016 May 06, 2016

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

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 ,
May 06, 2016 May 06, 2016

Do I just press that when on the page?

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 ,
May 06, 2016 May 06, 2016
LATEST

I deleted it all then did it again.... now its working....It was exactly the same text - bizarre!!! anyway thanks!!!!

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