Date in Java Script

Dear All IN Java Script I want to prompt for to user if enter past date ? can some one help me . I am getting date by getdate() . But how to check if it is less than today.if I am doing selecteddate<today[(new Date)] . it is not working.please have suggestions

Mike

Subject: Date in Java Script

I think this is what you are looking for:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

var frm;

frm=window.document.forms(0);

//… COMPARES SHIP DATE TO TODAYS DATE…

function compare_with_today() {

today=new Date()

var shipdate=frm.ShipDate.value;

shipd=new Date(shipdate)

rslt=(shipd.getDate()-today.getDate());

//alert (rslt);

if (shipdate==“” | (isNaN(rslt))) {

alert (“You must fill in Ship Date with a valid date.”);

return;}

if (rslt < 0) {

alert (“This date can not be before today.”);

};

};

compare_with_today() ;