I have 2 list boxes (month, year) for a credit card expiration date. I want a simple if..then statement to check if the card is expired. Here is what I have now:
if (document.basketform.ccexp.options[document.basketform.ccexp.selectedIndex].value == '01') && (document.basketform.year.options[document.basketform.year.selectedIndex].value == '01') {
rc=alert('Your Card has Expired!');
return false;
}
but it doesn't work. ccexp and year are the two names. I suppose having ti check against the actual date would be fancier but I'd settle for this. Any help is appreciated and worth a beer if you're in San Luis Obipos, CA .
if (document.basketform.ccexp.options[document.basketform.ccexp.selectedIndex].value == '01') && (document.basketform.year.options[document.basketform.year.selectedIndex].value == '01') {
rc=alert('Your Card has Expired!');
return false;
}
but it doesn't work. ccexp and year are the two names. I suppose having ti check against the actual date would be fancier but I'd settle for this. Any help is appreciated and worth a beer if you're in San Luis Obipos, CA .