Simple date check based on user input
Hi all
I've spent 3 days going through various posts and communities and am still stuck. It's not a difficult problem, but for some reason I cannot figure it out (I blame Daylight Savings Time LOL).
I'm using Adobe Acrobat DC and have two dates - Referral Date (ref_date) and Decision to Treat Date (dec_to_treat_date). All I want is a message (date_message) to show on the form if the Decision to Treat is greater than Referral Date. Here's my code at the moment, which is in my ref_date field as an ON BLUR action. For some reason, if I put the two dates in as the same month, it works, but if I put the dates in as different months, nothing happens. I've tried the Debugger without luck and as I'm brand new to JS, have no idea what other things I should look for.
Any ideas or suggestions would be greatly appreciated.
Chris
var d1 = this.getField("dec_to_treat_date").value;
var d2 = this.getField("ref_date").value;
var dm = getField("date_message");
if(d1 > d2)
{
dm.display = display.visible;
}
else
{
dm.display = display.hidden;
}
