Copy link to clipboard
Copied
I need to place a JavaScript in Document Actions in a PDF form filler I created. I have created several fields that I listed as "required fields" in the form. I was hoping that I could insert a Script that will return a message informing the user that they have not filled out all of the required fields when they try to click Save as or Print. I have the document saved as a read-only. It is my intention that the user will not be able to save a copy or print a copy of the document until they have filled out the required fields.
P.S. You would think that it wouldn't be very hard to remember to fill in your address and phone number but here we are.
Copy link to clipboard
Copied
The methods are "will save" and "will print". You can do various things, and issue messages, but it WILL then save or print; you cannot stop it.
Copy link to clipboard
Copied
Although it's not possible to completely prevent the file from saving or printing, it is possible to force the printed/saved copy to have all the form fields in it blank (while still showing them on screen), or to display an error message, if not all the required fields are filled-in.
To do that you would need to use a script to validate the fields in each of the Will-events.
I've developed a (paid-for) tool that allows you to set it up very easily. You can find it here: Custom-made Adobe Scripts: Acrobat -- Validate Required Fields Before Printing or Saving