Issue
You may have a situation where you need to prevent entry of a Future date in a field. You need to watch out for the differences in how date and time are obtained by different date objects to prevent changes in dates from morning to afternoon.
Important: replace the names used for getField with the actual field names you have.
Format tab: use the date format: mm/dd/yyyy
Action tab: Trigger is On Blur and Action is Run JavaScript
Script:
if (event.value!="") {
if (d.getTime()>new Date().getTime()) {
app.alert("You may not enter a date in the future.");
getField("DOB1").value="";
getField("DOB1").setFocus();
event.rc = false;
}
}
Comments