Skip to main content
Yellow Duckie
Participating Frequently
April 11, 2018
Question

Setting up preSave Validations

  • April 11, 2018
  • 1 reply
  • 1353 views

I need help.  I have scoured over countless posts/articles/how-to's, and I still can't figure this out!

I made a 6 page form with almost every field required.  It doesn't matter if they don't go in order, they just have to enter information before saving.

Fields are: text fields and radio buttons; no check boxes.

I found out that there is nothing preventing a user from saving an incomplete form.  Fine.

I found out how to make a pop-up alert when they click on a field and then click off, leaving it blank. Awesome, but ONLY if they first clicked on that field.  If they completely skip over it, not so awesome.

How do I make a message pop up when they save to ALERT them that they missed something on the WHOLE form?

In all of my research, I found stuff that points to preSave validations, but no one has ever explained the steps on going about executing this.  I have even found a post talking about executing an Action Script with a button, but it doesn't seem to work.

This form will only work if the required fields are actually ENFORCED.  Even if I have to add a button with JavaScript to enforce this message, I need someone to tell me what to do.  I've followed the steps for every other ActionScript needed, but I can't find this one.

Thanks.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 11, 2018

I've developed a tool exactly for this purpose. You can it it here: Custom-made Adobe Scripts: Acrobat -- Validate Required Fields Before Printing or Saving


Basically you need to write a code that checks if all the required fields are filled in and if they're not, show an error message.

The code then needs to be placed under Tools - JavaScript - Set Document Actions - Document Will Save.

As you've found out, though, this won't prevent the file from actually saving, although if you use my tool you can force it to save as a blank copy, until all the required information is filled in.

Yellow Duckie
Participating Frequently
April 11, 2018

I will not spend money on additional software.  I've seen your sales pitch in several other posts.  I've taken to overlooking it because you're spamming the Adobe forums with this one-fix tool.  I knew I'd run the risk of having you post it on my thread.

I've specifically outlined what I need in my question.  I am aware that prevention of saving is unavailable.  I am aware there are methods on having a popup instead.  I need help with understanding how to go about achieving it IN Adobe Acrobat Pro.

try67
Community Expert
Community Expert
April 11, 2018

I outlined how to do it in Acrobat. I've also posted code that validates all the required fields in the file on these forums, many times. You can find it if you search for it.

The tool I've developed is relevant to your question, so it's not spam. If you don't want to use it, that's fine, but don't expect others to do your work for you. And don't worry, I won't bother you again with my replies.