Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: verifying date

  1. #1
    joe
    joe is offline
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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”


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •