Card processing validating credit cards

In this page we have discussed how to validate a credit card number (in different format) using Java Script.

There are various companies in financial market offer credit cards.

But there are no common format in credit card numbering system, it varies company to company.

We are not sure that all the formats which we have discussed here are correct because time to time a company can change their numbering format.

li {list-style-type: none; font-size: 16pt; } { margin: auto; padding-top: 10px; padding-bottom: 10px; width: 400px; background : #D8F1F8; border: 1px soild silver; } h2 { margin-left: 38px; } input { font-size: 20pt; } input:focus, textarea:focus{ background-color: lightyellow; } input submit { font-size: 12pt; } { color: #FF0000; font-size: 10pt; } function cardnumber(inputtxt) { var cardno = /^(?




You can easily change a format with simply modify the regular expression which we have used for various cards.

Here are some format of some well known credit cards.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>