Highlighted

Need Help regarding Java script please.

Explorer ,
Aug 05, 2020

Copy link to clipboard

Copied

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

Views

35

Likes

Translate

Translate

Report

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

Need Help regarding Java script please.

Explorer ,
Aug 05, 2020

Copy link to clipboard

Copied

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

Views

36

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 05, 2020 0
Most Valuable Participant ,
Aug 06, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 06, 2020 0
Azid LATEST
Explorer ,
Aug 13, 2020

Copy link to clipboard

Copied

Hi mate, 

Managed to figure it out. 

Thanks for your help.

Regards, 

Azid 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 13, 2020 0