Credit Card Format Validation Forms jQuery Plugin

If you are working on any payment module system on your website and you have to validate user’s credit card information before form submit then in This post I am going to share one useful JavaScript library for building credit card forms, validating inputs, and formatting numbers.Payform is a jQuery-free JavaScript library used to format and validate form inputs related to credit card payments.
Supported card types:

  • Visa
  • MasterCard
  • American Express
  • Diners Club
  • Discover
  • UnionPay
  • JCB
  • Visa Electron
  • Maestro
  • Forbrugsforeningen
  • Dankort


Load Latest jQuery library and the jQuery payform plugin in the document.

<script src="//"></script>
<script src="dist/jquery.payform.js"></script>


Create credit card input forms where user will enter their credit card details and this plugin validate credit card details before for submit.

<div class="form-group">
  <label for="ccnum">Number</label>
  <input type="text" name="ccnum" id="ccnum" class="form-control">
<div class="form-group">
  <label for="expiry">Expiry</label>
  <input type="text" name="expiry" id="expiry" class="form-control">
<div class="form-group">
  <label for="cvc">CVC</label>
  <input type="text" name="cvc" id="cvc" class="form-control">
<div class="form-group">
  <label for="numeric">Numeric</label>
  <input type="text" name="numeric" id="numeric" class="form-control">


Call the plugin and enable credit card validator.


See live demo and download source code.


Generate sample credit card from this website ( and Test in Demo Page

This awesome plugin is developed by jondavidjohn. Visit their official github repository for more information and follow for future updates.