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

Confusion as to when specific scripts are triggered

lesliestoudt
Registered: Sep 14 2009
Posts: 8

I have read this board, Planet PDF, and the information provided by Adobe.

I see that we have the following places where scripts can be added for a text field:

1. Custom Keystroke Script
2. Custom Format Script
3. Custom Validation Script
4. Custom Calculation Script
5. Simplified Field Notation
6. Scripts associated with Actions

I have yet to find a good article or help to help me distinguish when each script is triggered, per se, and to understand when you would use a custom format script versus a custom keystroke script. I do understand the difference between formatting and validating keystrokes.

Also, I would assume one text field could have more than one type of script. However, which scripts take precedence? (sp? I had a gym teacher for English!) I would love to find a simple article or help -- so ... help!

Thank you

My Product Information:
Acrobat Standard 8.1.6, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Have you looked at the Acrobat JS API Reference?

There is a whole section, 'Form event processing', that flow charts the event in order of processing and preceding this section is a list describing the various event triggers.

George Kaiser

Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi lesliestoudt,

This short article and sample file has some helpful info on script location and usage-
http://www.4xpdf.com/2009/02/how-to-find-scripts-in-a-pdf/

In addition to the Acrobat JS API Reference mentioned above ( anyone scripting PDFs should have this handy), you can find many useful tutorials on JavaScript in the Learning Center at this site.

Training videos and sample PDFs that cover scripting events can be found at www.pdfscripting.com, although that is not a free resource ( requires a subscription).

Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
www.pdfscripting.com
lesliestoudt
Registered: Sep 14 2009
Posts: 8
Thank you for the information. However, after reading the documents in question, I still have a few questions (for now!).

The flow in the API Reference Manual states that some events are dependent upon others.
When reading Field/Validate, it says .... Data committed when you leave the field. (Therefore, Validate requires a mouse movement, tab, enter, etc. to be triggered (?).) - Further, it says "If successful, the next event is calculate". Does that mean that the Calculate script does NOT get run unless you have selected an option on the Validate tab other than "Do not validate"? So, Format, if you look at the diagram, depends on Validate and Calculate?

And, since Validate must be True or False, any custom script must set the event.rc value? Then, this value is used for Calculate and Format? (Hence, if format depends on the previous events, and these depend on an "Action" such as mouse exit, blur, tab, enter, or typing MORE than char Limit, they are not invoked should you simply reach CharLimit without further actions?