Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-20-2003, 12:58 PM   PM User | #1
joe
New to the CF scene

 
Join Date: Jan 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
joe is an unknown quantity at this point
Post verifying date

How do you validate a credit card expiration year and verify in comparison with the current date that the credit card expiration date is valid?
joe is offline   Reply With Quote
Old 01-20-2003, 10:25 PM   PM User | #2
beetle
Senior Coder

 
Join Date: Aug 2002
Posts: 3,467
Thanks: 0
Thanked 0 Times in 0 Posts
beetle has a little shameless behaviour in the past
In a nutshell....

var d = new Date();
var y = d.getFullYear();
if ( parseInt( document.formName.inputName.value, 10 ) < y )
alert( "Your card has expired!" );
__________________
My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
“Minds are like parachutes. They don't work unless they are open”
“Maturity is simply knowing when to not be immature”
beetle is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:56 AM.


Advertisement
Log in to turn off these ads.