I'm trying to call a javascript function in the validate event of a field in an XFA form. Actually, there are about ten fields with the same validation script. When the validate event fires, my form becomes unresponsive.
There seems to be some rules that require you to be very careful when writing validate event scripts.
I have read that even referencing a field can cause subsequent validate events to fire, even if the values don't change.
Do you know where I can get more information that describes, in detail, exactly how XFA validate events are triggered? I've read nothing about this in the Adobe documentation. The Adobe document provides no sample validate scripts either.
What I need is for the form to stop processing when it finds an invalid field (using the script's logic) and set the focus on that field. Is that even possible?
Thank you in advance.
console.println("Field: " + this.name + " Event: " + xfa.event.name);
Save and try out your form. You'll see each event reported in the Acrobat JavaScript Console.
Now add in some, but not all, of your most suspicious code and try the form again. You'll see exactly how these events are being hit.
More than likely your code is causing re-entrant behaviour. The console.println statments will show how this is happening.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script