I need to verify that a date of birth submitted in a date field isn't a future date. I'm guessing that would go in the Validate event for the control, but what code do I use to make the form's ExecValidate event return false if the date entered isn't acceptable?
This is quite simple. See this article on handling dates.
http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/date_time_part1/
The JavaScript Date Object has a function that returns the millisecond value of the date/time, "getTime()". This is the key value of the DateObject. So all you have to do is compare the millisecond values of the entered date with the current date.
Of course the first thing that needs to be done is parsing the entered date text into a date object. You'll find this in Part 2 of the article mentioned above.
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