I have a couple of problems with the validate event in a form. I have this event script on the subform. It validates correctly.
(this.Q14Total == 100);
1. The validation script runs when the form is loaded and of course fails because there is not any data entered.
2. Once in the subform (which is a series of text boxes that are added into a total box as values are entered). If you click out of the form, say to a radio button, and the validation fails the radio button still changes value if it was not "on" before. How can I prevent changing another control when the validation fails?
Thanks,
Start by placing console.println statements in all the relevant event scripts and watch the console window as they occur to get a good feel for how it all works. Try clicking fast and slow to look for changes in event ordering. Then put a setFocus call into the validate to see what happens.
Personally I don't think there's a thing you can do to stop someing like a radio button from being clicked. There are too many complex overlapping events and there are lots of timing issues that could cause even bigger problems. But it's worth a try to check it out. And it's a great learning experience.
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/]http://www.adobe.com/devnet/acrobat/[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script