These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Validating Form/Printing Specific Fields

aweise
Registered: Mar 23 2009
Posts: 12

Hi I need your help. Can you steer me in the right direction on how to do the following?

Deactivate print and display an alert box WHEN specific fields have not been filled out. This may get a little harry since there is text input, checkboxes, and or groups of text input fields where only one response is required, not all.

I have been looking and looking online I seem to spinning my wheels. I know I will probably need some type of javascript set up on ALL of the fields. Users who will be using this form will only be adding data and printing. They will not be submitting the form to a website so its important to get them to complete the form accurately and warn them when they may have omitted something.

Thank you in advance for your help!

Angela

My Product Information:
Acrobat Pro 9.1
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You cannot disable print at runtime. But you can validate fields and let the user know that the form is not complete. There is an "WillPrint" example at www.pdfscripting.com that displays a watermark on the form if the fields are not completely filled out before printing.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

aweise
Registered: Mar 23 2009
Posts: 12
I don't think a watermark will work in this situation. BTW I couldn't find the example you refer to--WillPrint. I thought it was under your free content and not paid material. I wish I had $139 to sign up for the premium membership on your site but alas I do not. Is there something else I can do such as work in form designer to solve my problem? We are trying to prevent end users from printing forms that are blank or incomplete.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
It's not in the free content, it's a "WillPrint" example file, which requires the premium membership. I'm afraid that neither forms technology, AcroForms or LiveCycle, is going to help you in this area. Preventing printing just isn't a feasible solution. What you can do is to alert the user. Both technologies have pre-print events, so you can do a form level validation and then let the user know if something is not right. That's why I like the watermark idea. If the user prints out an incorrect form it has a big Red "Not Valid" printed accross it.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

aweise
Registered: Mar 23 2009
Posts: 12
Thanks again for responding. Can I validate form fields only within Acrobat or will I need to do it within Forms Designer?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Both forms technologies provide several events that can be used to validate form field input, including of course the Validate event, which is available in both, and used to validate individual fields at the time they are filled in. Whole form validatation is usually performed by the form submit script, or in your case, by the pre-print event. You could also use a calculation event on a hidden field to validate the form in realtime, but this strategy could also cause performance problems. Depends on how big the form is and how many calculations it has running.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script