Monday, May 6, 2013

Credit Card validation with jQuery

This is a lightweight and easy to implement credit card validation with jQuery.
With jQuery, server processing is not required; and all the complexities are hide.
another way to validate credit card is with regular expression.

There is only 3 steps to validate credit card number with jQuery.

1. Install jQuery and jQuery validation plugin
<script src="" />

<script type="text/javascript" src="" />
for project already installed jQuery, first line is not required.

2. Create form and textbox to input credit card number.
<form id="myform">
  <label for="ccard">creditcard : </label>
  <input name="ccard" />

3. Create jQuery validation script.
    rules: {
      ccard: {
        creditcard: true


No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...