Credit Card Validation Library for Javascript
Posted · Category: Forms, License Free
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.
Requirements: Prototype Framework
Demo: https://github.com/madrobby/creditcard_js
License: License Free
3 Comments