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

how to prevent to date from being earlier than from date

rickstsx04
Level 3
Level 3

I have 2 date fields. I need to prevent users from being able to enter a to date to be earlier than the from date. I tried the following code, but it did not work:

var currentEpoch = TYBEGM.rawValue;

var dueEpoch = TYENDM.rawValue;

var logicTest = dueEpoch - currentEpoch;

If (logicTest < 0)

{

xfa.host.messageBox("Error! The Date Needed cannot be earlier than the current date.");

TYENDM.rawValue = "";

}

I'm not sure what I'm missing.

Any assistance is greatly appreciated!

0 Replies