Validating dates in this way is possible.
A typical approach would mean to create a Date Object from the entered values:
var theDate = util.scand("dd mm yyyy", this.getField("Date_DD").valueAsString + " " + this.getField("Date_MM").valueAsString + " " + this.getField("Date_YYYY").valueAsString) ;
Now, when there are illegal values in the fields, util.scand()
returns null
, which you then can catch and bring up an alert.
With that Date Object, you can do whatever is needed.
Please forgive the shameless plug, but there are datepickers out there for Acroforms. I happen to have developed one which is said to be very good, and working quite flawlessly. If there is an interest for this datepicker, feel free to contact me in private; my eMail address can be found in my profile.
Hope this can help.
Max Wyss.