Skip to main content
January 9, 2020
Answered

Hide layer with button click

  • January 9, 2020
  • 1 reply
  • 5285 views

Hi, I am trying to hide my layer called question Mark's when I click my save button that I created. I think I need javascript. I understand how to show/hide fields but not sure what script to use for this. Any help is appreciated. Thank you.

This topic has been closed for replies.
Correct answer Thom Parker

You don't need a Script, use the "Set Layer Visibility" action

To use this, set your layer to hidden on the Layers panel. Then set this action on the button. Now show your layer. When the button is pressed the layer will be hidden. 

1 reply

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
January 9, 2020

You don't need a Script, use the "Set Layer Visibility" action

To use this, set your layer to hidden on the Layers panel. Then set this action on the button. Now show your layer. When the button is pressed the layer will be hidden. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
January 9, 2020

I just tried that. When I check hide it just takes away the layer but i need it to be visible until i press the save button.  Unless I am pressing the wrong hide... all I have for hide on my panel is a square with an eye in it. Is that it?

Thom Parker
Community Expert
Community Expert
January 9, 2020

You are correct. The idea is to set the layer visibilty to the desired state when the button is pushed. Then you add or set the "Set Layer Visibility" action. Now you can changer the layer visibility what you want it to be normally. 

 

 

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