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

How to I do to let the specific field be hidden?

New Here ,
Jul 21, 2018 Jul 21, 2018

Copy link to clipboard

Copied

1) Initially, Field A and Field B are visible for person to input.

2) During input some words in Field A (eg. Peter)

3) After input words, Field B is hidden. Person cannot input anything in Field B.

4) If I delete the words in field A (Become blank), Field B becomes visible again.

I don't know how to make the java-script code for this activity. Would you mind help me design? Thank You.

TOPICS
Acrobat SDK and JavaScript

Views

119

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
community guidelines
Community Expert ,
Jul 22, 2018 Jul 22, 2018

Copy link to clipboard

Copied

Hi,

Add this code to the validation event of Field A

if ( event.value !== "")

{

     // replacing to use recommended method

     // [DEPRICATED} this.getField("Field B").hidden = true;

     this.getField"Field B").display = display.hidden;

}

else

{

     // replacing to use recommended method

     // [DEPRICATED] this.getField("Field B").hidden = false;

      this.getField"Field B").display = display.visible;

}

Make sure the text inside the quotes matches the name of Field B.

Hope this helps

Malcolm

{edit: as per comment below, to make sure anyone finding in the future gets the correct code )

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
community guidelines
Community Expert ,
Jul 22, 2018 Jul 22, 2018

Copy link to clipboard

Copied

It is not recommended to use the hidden property, since it has been deprecated.

You should use the display property instead, like this:

this.getField("Field B").display = display.hidden;

Or:

this.getField("Field B").display = display.visible;

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
community guidelines
New Here ,
Jul 22, 2018 Jul 22, 2018

Copy link to clipboard

Copied

LATEST

Thank you for your reply. It save me a lot of time.

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
community guidelines