- Moderator
- #1
I evidently have users that don't know what year they live in. This is made obvious by the fact that they keep putting future dates in a report they're required to fill out.
Anyway... I have a masked-input date field, and I need a simple javascript validation to pop an alert if they put in a future date.
Something like:
.... so, why is this kicking my butt today? :-(
Just my 2¢
"What the captain doesn't realize is that we've secretly exchanged his dilithium crystals for new Folger's Crystals." -- My Sister
--Greg
Anyway... I have a masked-input date field, and I need a simple javascript validation to pop an alert if they put in a future date.
Something like:
Code:
var today = New Date();
var strDate = New Date(document.form.thedate.value);
if(strDate > today){
alert("Time travel hasn't been invented yet! That date is in the future!);
return false;
}
.... so, why is this kicking my butt today? :-(
Just my 2¢
"What the captain doesn't realize is that we've secretly exchanged his dilithium crystals for new Folger's Crystals." -- My Sister
--Greg