CreditCard.js is a credit card validation library for JavaScript using Prototype. Using CreditCard.validate(’1111 2222 3333 4444′) returns true/false, the given string is automatically stripped of whitespace, so it can be plugged directly into form validations.

It checks if the luhn validation code add up, and the range and the length of the numbers. You can do the card identification via CreditCard.type(string) returns “Visa”, “MasterCard”, etc.

Published under: Forms | License Free

blog comments powered by Disqus