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

Display.Hidden not working?

Explorer ,
Apr 17, 2019 Apr 17, 2019

Copy link to clipboard

Copied

Hello -

I am hoping someone might be able to tell me why the below does not work? Basically, I am trying to hide a button; using another button. From the research I have found, it seems the below should work...but it doesn't...nothing happens? 😞

Anyone have any ideas as to what may be preventing the below from working:

Button name: Attach

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

Thanks in advance for your time

TOPICS
Acrobat SDK and JavaScript

Views

1.1K

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

correct answers 1 Correct answer

Explorer , Apr 17, 2019 Apr 17, 2019

Never mind...I found it...just removed the "this." and all is well

Final working result:

getField("Attach").display = display.hidden;

Thank you

Votes

Translate

Translate
Explorer ,
Apr 17, 2019 Apr 17, 2019

Copy link to clipboard

Copied

Never mind...I found it...just removed the "this." and all is well

Final working result:

getField("Attach").display = display.hidden;

Thank you

Votes

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 ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

That should not matter. From what context did you run this code?

Votes

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
Explorer ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

Hi Try67 -

Yes, I would not have thought that would have mattered; but apparently with buttons it does. It works fine on text box fields with the "this." included; but not buttons for whatever reason? When I removed the "this." it worked on the button(s).

I was using this in the Action control, Mouse Up, Run Java Script

Votes

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 ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

Works fine for me.

Votes

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
Explorer ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

Well now that is interesting...ya, I only had the one line for testing purposes...for whatever reasons it was not working with buttons, for me; only text box fields. I am using Pro X...not sure if that makes a diff?

Votes

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 ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

I tried it in XI Pro. Could be a bug in your specific version.

Votes

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
Explorer ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

It is puzzling...thanks for your response and input Try67. Not sure why, but got it to work. Hopefully this will help anyone else out there that may have or is experiencing something similar.

Thanks again

Best regards

Votes

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 ,
Apr 18, 2019 Apr 18, 2019

Copy link to clipboard

Copied

it sounds like something is happening to change the context of the event.

put this code in the same button script and let us know the result that shows in the console window:

console.println("test:" + this.toString()");

it should print

[object Doc]

if not, then something is off.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
Explorer ,
Apr 19, 2019 Apr 19, 2019

Copy link to clipboard

Copied

Hi Thom -

Well...hmmmm...I can't seem to get past this?

2019-04-19_14-33-45.jpg

Votes

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 ,
Apr 19, 2019 Apr 19, 2019

Copy link to clipboard

Copied

LATEST

Drop the last set of double-quotes.

Votes

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