I need Custom calculation script for an alert message when a user enters a date prior to the current date but still displays what the user had entered
What I have so far but does not work. Basically I just want an alert message to pop up when the user picks a date prior to the current date (today's date) but still allows the date to be entered. The field named as "EffectiveDate" with format date: mm/dd/yyyy. I know very little when it comes to Acrobat JavaScript. Please help.
I have placed this under the Text Field Properties/Calculate/Custom calculation script section:
var sStart = this.getField("EffectiveDate").value;
var d2 = new Date();
d2.setHours(0,0,0,0);
if(sStart.length )
{
var dateStart = util.scand("mm/dd/yyyy",sStart);
if(sStart < d2 )
{
app.alert("The Effective Date entered is before today's date.");
event.value == "";
resetForm(["EffectiveDate"]);
}
}