H
Harlan Dorado
Hi,
I'm trying to write a function to compare a date posted from a text
field in
an asp-page to the date today. The idea is that the date entered in the
form
field cannot be in the past. This is my function:
function chkDate(){
var dDate = Date()
if(document.frmDate.txtDate.value<dDate){
alert("You've entered a date in the past, please try again.");
return false;
}
}
It seems to me that my script doesn't understand that I enter a date,
because I always receive the alert - no matter what I put in the text
field.
I probably have to convert the value or something. Or perhaps I'm
testing
the wrong property....
Being a novice in javascript I can certainly sit here and wonder, but
some
of you guys probably spot immediately what I do wrong and what needs to
be
changed.
Thanks for any reply.
Harlan
______________
the woim toins
I'm trying to write a function to compare a date posted from a text
field in
an asp-page to the date today. The idea is that the date entered in the
form
field cannot be in the past. This is my function:
function chkDate(){
var dDate = Date()
if(document.frmDate.txtDate.value<dDate){
alert("You've entered a date in the past, please try again.");
return false;
}
}
It seems to me that my script doesn't understand that I enter a date,
because I always receive the alert - no matter what I put in the text
field.
I probably have to convert the value or something. Or perhaps I'm
testing
the wrong property....
Being a novice in javascript I can certainly sit here and wonder, but
some
of you guys probably spot immediately what I do wrong and what needs to
be
changed.
Thanks for any reply.
Harlan
______________
the woim toins