Skip to main content
Participant
Dec 27, 2019 5:55 AM UTC
Question

Hide and show fields on button click in adobe acrobat

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.

9 replies

try67
Community Expert
Community Expert
Dec 27, 2019 2:46 PM UTC

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;

Translate
try67
Community Expert
Community Expert
Dec 27, 2019 3:11 PM UTC

Edit: Fixed small mistake in the code above.

Translate
Dec 27, 2019 2:30 PM UTC

Moving to the Acrobat forum from Community Help

Translate