Hi Billy,

   I appreciate your time in writing that code.

   But it is giving a -ve value for the objFrmDate.getTime();

   and giving the false for the form date which has todays date.

Thanks,
Sudheer Chakka




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


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



______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
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