Shouldn't the conditional read: if (d < dNow) ??
-----Original Message-----
From: slewitan@e... [mailto:slewitan@e...]
Sent: Tuesday, June 04, 2002 4:57 PM
To: javascript
Subject: [javascript] credit card expiration date validation
Hi All,
I am working on script for credit card expiration date validation it isn't
working, any suggestions. Also I am concerned that the time of day will
mess things up. I'm not concerned about time zones.
Thanks,
Sam
dYear = document.frmShipInfo.Card_ExpDate_Year.options
[document.frmShipInfo.Card_ExpDate_Year.selectedIndex].value
dMonth = document.frmShipInfo.Card_ExpDate_Month.options
[document.frmShipInfo.Card_ExpDate_Month.selectedIndex].value
dNow = new Date()
arryEndDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
d = new Date(dYear,dMonth-1,arryEndDays[dMonth-1]+1)
if(d > dNow)
{
alert("Your Credit Card has expired\n")
return false
}