Does anyone have a library or JavaScript snippet to verify the check digit of credit cards before the user hits Submit?
+1
A:
I have found one with demo on google for
- MasterCard
- Visa
- American Express
- Diners Club
- Discover
- enRoute
- JCB
codemeit
2008-11-01 03:00:29
+4
A:
The jQuery Validation Plugin has a method for validating credit card numbers.
There are other specific scripts:
Most of them use the Luhn algorithm.
CMS
2008-11-01 03:52:49
A:
You can use this function if you're not already using the jQuery plugin. It's based on the Luhn algorithm and is tolerant of spaces or dashes so should work for most data entry cases you would need it for.
http://af-design.com/blog/2010/08/18/validating-credit-card-numbers/
Erik Giberti
2010-08-18 16:33:17