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

Execute Validation javascript from IAC

john0414
Registered: Jan 25 2008
Posts: 2

Hi - I have a form that I want to populate from a database. My problem is that the database may not have valid data. The form contains validation logic in various javascripts that respond to mouse events and validate events. Is there any way I can fire those events, or run the javascript code using IAC (Inter-Application Communication) in C# or VB? This way, I don't have to re-write the validation logic in C#. Thank you.

My Product Information:
Acrobat Pro 8.1.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes and No. Simply loading data into the form from the IAC should trigger those scripts. In a LiveCycle document, the validation scripts can be trigged with the "execValidate()" function. Use the JSO to access the Acrobat JS model. However, it doesn't do you too much good if you need the validation info from the VB program.

You'll have to setup the form to provide you with this info. For example, make the validation scripts availible as functions in the document, then run them from the JSO object in the IAC before populating the fields. Or you could save validation state info in the form that's accessible to the JSO after the data has been loaded.

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