If(Date.parse(startDate) <= Date. If month is not valid i.e not in range 1-12Ĭase 2:expYearCheck=2000+parseInt(expDateArr, 10) break // If YY format convert it to 20YY to itĬase 4:expYearCheck=expDateArr break // If YYYY format assign it to check Year VarĮxpDate=new Date(eval(expYearCheck),(eval(expDateArr)-1),1,0,0,0,0) If(expDateArr.length>2)return false // Return false if no num/num format found If(separatorIndex=-1)return false // Return false if no / found at 12:22 2 Exist a jQuery plugin to do that: jQuery Credit Card Validator Teo at 12:32 Add a comment 2 Answers Sorted by: 1 You can prevent user typing incorrect value in the first place using jQuery Mask Plugin ('debit'). Var separatorIndex = expDate.indexOf('/') It provides a stand-alone script along with a jQuery plugin compatible with jQuery versions 1.9.1 and 2.0.0. Var futureLimitDate= new Date(today.getFullYear()+10,today.getMonth(),1,0,0,0,0) CardCheck is a credit card validator and type predictor. Var startDate = new Date(today.getFullYear(),today.getMonth(),1,0,0,0,0) It allows m/yy or m/yyyy format for expiry date. Overlap of Discover, Solo and Switch is handled and NOT matched. If you need previous versions, you’ll find them on the releases page. Maestro ONLY card matching begins with 50 or 56-58 or 6 & 13 to 20 total digits. Download The latest stable version is always in master branch. It’ll tell you the detected credit card type and whether the number length and Luhn checksum are valid for the type of card. I think following solution will work for validating credit card expiry date. jQuery Credit Card Validator detects and validates credit card numbers. ValidMYCard is a Credit Card Generator & Validator built with jQuery that generates random credit card numbers and checks you type the right numbers (card type, length, luhn). Credit Card Formatter Credit Card Formatter is a very small jQuery plugin for a credit card input that formats numbers and tells you the detected credit card type. Copy the code into the HEAD of your HTML document 2. cardCheck Cardcheck.js is a very small jQuery plugin for e-commerce websites that validates the credit card numbers as well as telling you the detected credit card type. I have done little modification to the code. TWO STEPS TO INSTALL CREDIT CARD NUMBER VALIDATION: 1.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |