Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Date / Calendar validation.

Avatar

Not applicable

Hi there,

i need some help with date fields and calendar validation.

My issue is not only a pattern issue ...

In my PDF modules when i have date fields, users are allowed to choose a date from calendar but also to write the date with this pattern: DD MMMM YYYY (eg 19 December 2011).

Using pattern i see that is possible to fill the date field with the following entry:  34 December 200000011 !

Does anyone have a validation function or some tricks to allow user to fill the field only with real dates based on calendar?

Thx

1 Reply

Avatar

Level 7

You can do a script like the following which will clear the entry if they don't follow the correct pattern:

(if formcalc in the exit event for the calendar)

var startDate = $.formattedValue

if (Date2Num(startDate, "DD/MMMM/YYYY") == 0) then

$=""

endif

the Date2Num will give 0 if the pattern isn't correct.