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

Validating a Date Field

Amie
Registered: Sep 7 2009
Posts: 17

Hi all,

I've a requirement wherin i have to validate a date field in my adobe form.

-> Firstly it has to pop up an error message if at all the field is empty.

-> Secondly it has to pop up an error message if the entered date is less than today's date.

-> Thirdly, it has to pop up an error message if the entered date is >30days from todays date.

The date format am using is YYYYMMDD.

Please help me out.

Thanks in advance.

Regards,
Amie

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Have you looked at the 'Date2Num()" and "Num2Date()" functions. One could take the date to validate and use the "Date2Num()" function to convert it to the number of days since the epoch date or 0 if an error and then use the "Num2Date()" to convert the number of days back to a string. Now compare the string for equality, if false the validation failed.

George Kaiser