Skip to main content
New Participant
December 27, 2019
Question

Hide and show fields on button click in adobe acrobat

  • December 27, 2019
  • 2 replies
  • 4941 views

I'm creating a PDF template using Adobe Acrobat, in which I'm trying to hide and show fields on button click.

My requirement is - on first click a field should be shown and on second click a same field should get hide.

My issue is - field is getting visible on first click but it doens't get hide on second click.

Can anyone please help me out with this.

Thanks in advance.

2 replies

try67
Community Expert
December 27, 2019

You need to use a script to do it. Something like this:

var f = this.getField("FieldName");

f.display = (f.display==display.visible) ? display.hidden : display.visible;

jenriqueusa
Participating Frequently
February 24, 2020

This one works for me but only in one field. I need to hide/show several fields with one button. How shoud I modifiy the code?

Thank you

try67
Community Expert
February 24, 2020

Duplicate the code, adjusting the field name in the first line each time.

December 27, 2019

Moving to the Acrobat forum from Community Help