Skip to main content
Known Participant
June 26, 2019
Question

show/hide and reset only once, when doc opens

  • June 26, 2019
  • 1 reply
  • 841 views

Hello all. I have a 3 page doc that I'd like to show/hide and reset certain fields only once. Once, at the time of opening the doc. I'm trying to have a fresh page every time I open the doc. Not, when navigating to the next page and then going back to the opening first page. I've searched a bit trying to find an example of javascript that will do the job without any luck. Can someone point me in the right direction to accomplishing this? Thank you for the help.

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
June 26, 2019

Use the code at document open.

try67
Community Expert
Community Expert
June 26, 2019

To elaborate: Go to Tools - JavaScript - Document JavaScripst and create a new item there. Remove the function definition that is created by default and replace it with your code. Save the file and the code will only execute once, when you open the file.

pdfUser1Author
Known Participant
June 26, 2019

I've tried to insert the code as you guys directed. It does what I want, but I click Save from the Menu (File>Save) to Save but then when I click to close the doc a window opens asking if I want to Save it again. Can I just Save one time? Instead of twice?