Display.Hidden not working?

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

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

Final working result:

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

Thank you

TOPICS
Acrobat SDK and JavaScript

Views

545

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

Display.Hidden not working?

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

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

Final working result:

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

Thank you

TOPICS
Acrobat SDK and JavaScript

Views

546

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
Apr 17, 2019 0
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

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

Copy link to clipboard

Copied

That should not matter. From what context did you run this 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
Reply
Loading...
Apr 18, 2019 0
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

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

Copy link to clipboard

Copied

Works fine for me.

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

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

Copy link to clipboard

Copied

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

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

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

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

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...
Apr 19, 2019 0
try67 LATEST
Apr 19, 2019

Copy link to clipboard

Copied

Drop the last set of double-quotes.

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