Neuwbs
Neuwbs

Reputation: 37

Validating PDF form fields before printing

I have a fillable PDF form that I would like to validate before the user prints it out.

Here is my form:

http://www.pentco.com/orderforms/pentco_creditapp_v2011b.pdf

I've looked online for a simple solution and I think I've found it. It is here:

http://www.alqemy.com/Forms/RequiredFields.pdf

I've looked at its field and button properties, but for the life of me I cannot figure out how it works. There is one line of code attached to the button behaviour and that's it.

Can someone tell me what I'm missing to put the same validation function in this form into mine?

Pete

Upvotes: 2

Views: 10784

Answers (2)

josh
josh

Reputation: 1

This worked perfect...thanks for pointing out where to find that JavaScript. If others are confused:

You need to be in form edit

Then you go to Advanced-->Document Processing-->Edit All Javascript...

You will find the Validation code there. You want to copy it and add it to your print button's Javascript

Upvotes: 0

iPDFdev
iPDFdev

Reputation: 5834

The validateFields() method (used on button's mouse up event) is defined at document level. With Acrobat select 'Edit All JavaScripts' menu item and you will see the code for this method. It can be reused very easy, you just have to set tooltips for all required fields and these tooltips must end with '*' (this is how the method determines if a field is required).

Upvotes: 5

Related Questions