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
Adobe 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

jenriqueusa
Participating Frequently
February 24, 2020

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


Great. It worked. Now, is there a way to put all the names together in one line, having the fields the same name but ending in a different number?
Something like ("Field1", "Field2", "Field3", Etc.)

December 27, 2019

Moving to the Acrobat forum from Community Help