|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (8 bit)
|
Why is this script not working?!
Here's the script
Code:
function select_check()
{
var Today2=new Date();
var ThisMonth2=Today2.getMonth()+1;
var ThisYear2=Today2.getFullYear();
var selected_month2=eval(document.CC.selectmonth.value);
var selected_year2=eval(document.CC.selectyear.value);
if ((selected_month2 < ThisMonth2) && (selected_year2 <= ThisYear2)) //Both conditions have to be true
alert("Credit Card is invalid");
else
alert("Credit Card is valid");
}
Code:
Visa
Mastercard
American Express
Discover
Last edited by racerxfactor; 06-01-2005 at 09:08 AM. |
|
|
|
|
|
#2 |
|
Staff
Premium Member
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
|
Don't see the attachment. If it is html, you will have to save it as txt to attach it here.
It appears that you are saying that if the date listed in the select box is less than today's date, the credit card is invalid but if it is greater than it is valid. That doesn't mean it is valid and I would skip the alert telling them that it is valid when it may not be. It doesn't mean that it is valid, it only means that it is not invalid so no alert is necessary. |
|
|
|
|
|
#3 |
|
Member (8 bit)
|
Here's the html file in txt.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|