Thread: Date validation
View Single Post
  #4 (permalink)  
Old February 25th, 2004, 03:10 PM
Raul Raul is offline
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

function doDateCheck(FchIni, FchFin, mydt)
{
    var dt = new Date();
    if (Date.parse(FchIni.value) >= Date.parse(FchFin.value))
    {
    alert("Start date can't be greater than end date.");
    return false;
    }
    if (Date.parse(FchIni.value) < dt)
    {
    alert("Start Date must be equal or greater than todays date" + dt);
    return false;
    }
}

When the user inputs todays date it still fires the alert. I think it has something to do with the time being included. Is there a way to cut out the time or a work around.

Reply With Quote