Skip to main content
Participating Frequently
October 16, 2024
Answered

PDF form field set to visible but doesn't print gets changed after using show/hide

  • October 16, 2024
  • 2 replies
  • 1919 views

Button form field set to visible but doesn't print gets changed to visible after using another button to show/hide that field.

I created a button "Show Writing Exercise" to show a hidden text field "Writing exercise" so the user could type in that text field.
The "Show Writing Exercise" button is set to Visible, but doesn't print.
Clicking the "Show Writing Exercise" button has action changing the "Writing exercise" field to Show and the "Show Writing Exercise" button to Hide.

The user then needs a way to reset the button and hide the text field back to their earlier states, so I created a second button "Reset"  that changes the "Show Writing Exercise" button to Show and the "Writing Exercise" text field to Hide.

When this reset happens, the "Show Writing Exercise" button is changed to Visible, not what it was set to, originally which was Visible but doesn't print. I've captured two screenshots showing the Print dialog before and after the Show/Hide where you can see the "Show Writing Exercise" button change its printing state.

This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
JR BoulayCommunity ExpertCorrect answer
Community Expert
October 16, 2024
Acrobate du PDF, InDesigner et Photoshopographe
Participating Frequently
October 16, 2024

and so, your teaching has set me free to fish
Turns out I needed to tweak Js in two button fields to manage the interactions

Grateful

PDF Automation Station
Community Expert
Community Expert
October 16, 2024

Using show/hide in the actions only has 2 options: visible and hidden (show and hide).  Remove action and enter the following script as Mouse Up action under the action "Run a JavaScript":

this.getField("Show Writing Exercise").display=display.noPrint;
this.getField("Writing Exercise").display=display.hidden;
this.resetForm(["Writing Exercise"]);

Participating Frequently
October 16, 2024

Thank you so much for quick reply. I inserted your Js but it makes the Writing Exercise field flash on and off.
I need the Show Writing Exercise button to Hide and the Writing Exercise field to Show.
Then Reset button makes the Show Writing Exercise button to Show (and keep it as Visible but doesn't print) and the Writing exercise gets hidden.
Can you please change the PDF and send back to me?
Thanks as always for great Community support.

PDF Automation Station
Community Expert
Community Expert
October 17, 2024
Hide_Test_modified.pdf