Use the Date object in JS:

(Haven't tested this, coding off the cuff):

objFrmDate = new Date(frm.year.value,frm.month.value,frm.days.value);
objToday = new Date();

// getTime method converts to ms since 1/1/70, allowing for absolute
date comparison
numFrmDate = objFrmDate.getTime(); 
numToday = objToday.getTime();

if (numFrmDate >= numToday) {
        // date is greater than or equal to today
        return true;
} else {
        return false;
}

Good info on the date object:
http://developer.netscape.com/viewsource/goodman_dateobject.html

---
Billy Cravens



-----Original Message-----
From: Chakka, Sudheer [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, May 01, 2002 12:50 PM
To: CF-Talk
Subject: JavaScript - Validation of Date - 3 Drop down lits 

Hi,
    Does any body have Javascript code snippet that validates the date.

   I have a 3 drop lists (Year- 02 format , Month - 01 format, day - 01
format)
   I have to check the date selected by the user is greater or equal to
today's date .
   I am combining all the three values 

  I am stuck with this, as it is giving the int value of the combined
string
(parseInt()) as 0.

  I think there is a better way of doing this.


Thanks in advance.
Sudheer Chakka


______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to