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

Need Help regarding Java script please.

Explorer ,
Aug 05, 2020 Aug 05, 2020

Hi there,

(File attached)

I want if client click green box FIELDS in Green writing (part A) should be APPEARING and fields in RED writing (Part B) should disappear.
And vice versa ie (if client click red bx fields in green writing fields should disappear and fields RED writing should appear and should be compulsory to fill in. Using followoing script

 

If click YES (field will become active)

var titleFld = this.getField("...")

if (event.target.value == "Yes")    {

    titleFld.hidden = false

}

else    {

    titleFld.hidden = true

}

 

If click NO (field will become inactive)

var titleFld = this.getField(".......")

if (event.target.value == "No")    {

    titleFld.hidden = true

}

else    {

    titleFld.hidden = false

}

The script works for making same field active and inactive but not working for above mentioned purpose. 

 

Thanks in anticipation. 

 

Regards 

TOPICS
PDF forms
345
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 ,
Aug 06, 2020 Aug 06, 2020

You can make the fields hidden, but the rest of the text on the page will still be there... The code you posted should do that, although you should really use the display property instead of the hidden one, as the latter is deprecated and might not work in the future.

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
Explorer ,
Aug 13, 2020 Aug 13, 2020
LATEST

Hi mate, 

Managed to figure it out. 

Thanks for your help.

Regards, 

Azid 

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