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

Show Required fields before Saving or Printing

Mollies Mom
Registered: Feb 10 2010
Posts: 8

I have an form created in Acrobat Pro 9 that has conditionally required fields based on input values from either text fields or checkboxes.

I have a button "show required" that hightlights the require fields and another "restore required" button that removes highlighting off the fields. Initially, theh form opens with no highlighting.

I want to execute "show required" before either printing and/or saving, and execute pop-up a message that asks the user to make sure the highlighted fields have been completed.

My client doesn't want to restrict printing or saving, simply warn the user before finishing the form.

Can someone lend some help re. script to enter and where to put it?

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
In Acrobat there is a WillPrint event, this is where the code needs to go. Here's an article that covers the event:
http://www.acrobatusers.com/tutorials/2006/document_actions

The highlighting is turned on with:

app.runtimeHighlight = true;

Althought this doesn't specifically Highlight required fields, it just turns on highlighting.

To warn the user you'll need to write code to test all the required fields and display a popup message.
To display a popup box see this article:
http://www.acrobatusers.com/tutorials/2006/popup_windows_part1

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]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

Mollies Mom
Registered: Feb 10 2010
Posts: 8
Hey, thanks for the info. I didn't do a reply at the time. The user decided they didn't need to show required fields before saving or printing after all, but your information was quite helpful. I had come across one of the articles you referenced so at least I know I was on the right track. Thanks again.