Skip to main content
jeffreyg26558119
Known Participant
September 18, 2019
Question

Form Validation On Print

  • September 18, 2019
  • 2 replies
  • 4387 views

Hello,

How do I validate a PDF before the person is allowed to print it? I basically want this functionality:

https://www.youtube.com/watch?v=a_i3ZszohnI

Any assistance would be awesome!

 

I have attached the document I am working on. There is other javascript in there for the drop downs, but I cannot seem to get the ON PRINT validation working.

 

I am using Adobe Acrobat DC.

 

Thank you,

This topic has been closed for replies.

2 replies

Participating Frequently
May 7, 2020

Can you share your PDF file  as i cannot download the attached link

Bernd Alheit
Community Expert
Community Expert
September 18, 2019

You have a function with the name "validateFields", but you doesn't use/call the function.

jeffreyg26558119
Known Participant
September 18, 2019

Yes! I noticed that and fixed it, thanks! Another question, do you know how to update the javascript so each of the missing fields appear on a new line? Right not the script has them displayed with a comma.

 

I have attached up the updated working file. Try printing it as soon as you open it and you will see what I mean.

Thanks!

Bernd Alheit
Community Expert
Community Expert
September 19, 2019
Try this: app.alert('There are '+flg+' fields that require a value\n\n'+ fArr.toString().replace(/,/g, "\n"), 3);