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
BedrockMission!

Learn More

View all

Sign in to view all badges

Form Guides: trying to do a date comparison

Avatar

16-12-2008

Hi,



I'm trying to do a simple data comparison using Javascript within a form guide. Here is what I came up with:



if (this.rawValue > util.printd("yyyy-mm-dd", new Date())) {

xfa.host.messageBox ("date cannot be in the future");

}



this works great on the PDF form, on the form guide it returns an error about "util" being undefined.



Is there a way to do this without having to manually parse date strings?



Regards,



Steve

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

16-12-2008

The util.printd is not supported in guides. Remember that this is based on XFA forms and Action script running inside of a Flex application. I would suggest that you will have to use parsing to get what you want as there is no Date mapping between the two.

Avatar

16-12-2008

This seemed to work:



if (new Date(this.rawValue + " 00:00:00") > new Date()) {



xfa.host.messageBox("Date cannot be in the future.");

}



It only seems to work on the form guide, and I had to set the display Date property on the PDF form for the date field to be:



date{MM/DD/YYYY}



Regards,



Steve