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

Custom field validation scripts not firing?

CarolinaPower
Registered: Mar 26 2009
Posts: 43

Do I have to test for an event? I had assumed that the script only fired after user had left field (keystroke or some such).

My Product Information:
Acrobat Standard 9.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Explain what you mean by the "scripts not firing"? How do you know?

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

CarolinaPower
Registered: Mar 26 2009
Posts: 43
I am moving a message to a hidden alert box on the form using an if / else (no statement appearing after I enter data in second date field and tab or enter out of that same field).
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I think it's much more likely that your script is in error. I've been writing PDF scripts for quite a few years now and the validation event always fires when it's supposed to.

What exactly is a "hidden alert box"? Do you mean a hidden text field that will be used as an alert message at some later time?

The first thing you need to do is to check the Acrobat JavaScript Console Window to see if an error has been reported? Here's an article on using the Console.
http://www.acrobatusers.com/tutorials/2006/javascript_console

Next, display direct evidence of the problem by printing data from your script into the console. Place console.println() statements on the first line of the Validate script (as a sanity check) and inside both sections of the if/else. Use the first console.println() to display the test conditions used by the "if".

This debugging technique will allow you to see more of what's going on in the script.

On another note. When you post these questions it would be very helpful if you would provide a short, explicit explaination of what you are trying to do and the symtoms of the problem.

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