Credit Card Validator In Vanilla JavaScript - MalikDzgn
  • Jelajahi

    Copyright © MalikDzgn -

    vendredi 12 février 2021

    Credit Card Validator In Vanilla JavaScript

    Credit Card Validator In Vanilla JavaScript

     

    Credit Card Validator In Vanilla JavaScript

    Category: Form , Javascript | August 22, 2017
    AUTHOR:gilsjhonny
    VIEWS TOTAL:2,679 views
    OFFICIAL PAGE:Go to website
    LAST UPDATE:August 22, 2017
    LICENSE:MIT

    Preview:

    Credit Card Validator In Vanilla JavaScript

    Description:

    A vanilla JavaScript credit card validator that detects the card type and limits the length of credit card numbers.

    How to use it:

    Load the necessary VanillaMasker library in the html document.

    <script src="https://cdnjs.cloudflare.com/ajax/libs/vanilla-masker/1.2.0/vanilla-masker.min.js"></script>

    Load the vanilla card validator:

    <script src="assets/cardValidator.bundle.js"></script>

    Create the credit card input.

    <form>
      <div name="card-container">
          <input type="text" id="card" maxlength="16" />
          <label class="card-label" for="">Credit Card</label>
          <div id="logo"></div>
      </div>
    </form>

    Share with your friends

    Give us your opinion
    Show Comments
    Close Comment