Hernán Pérez


How to Detect Credit Card Type in Javascript

In this video tutorial, you will learn how to detect credit card type in javascript.

Subscribe : https://www.youtube.com/channel/UCBwPlFFaigg5WA-Y1Iz-HUA

Source Code:


<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
        <input type="text">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/cleave.js/1.5.8/cleave.min.js"></script>
    <script src="script.js"></script>


body {
    text-align: center;
div {
    display: inline-block;
button, input {
    display: inline-block;
    padding: 10px 20px;


let btnCheck = document.querySelector('button');
let result = document.querySelector('h1');
let cardType;
var cleave = new Cleave('input', {
    creditCard: true,
    delimiter: '-',
    onCreditCardTypeChanged: type => cardType = type
btnCheck.addEventListener('click', () => {
    result.innerText = `${cleave.getFormattedValue()} - ${cardType}`;

#js #javascript #html

What is GEEK

Buddha Community

How to Detect Credit Card Type in Javascript

Credit card fraud and technical solutions

Credit card fraud is an increasingly expensive problem. Technology offers solutions to help combat the problem and gain control.
How to prevent fraudulent transactions in credit cards is a common question plaguing the credit card user today. The credit card brings convenience and security to the users, but the same can become a cause of agony if the user is a victim of any credit card fraud. Smart systems are coming to the aid of credit card users and empowering them against cybercriminals. Using fraud detection tools and following some simple precautions, the users can protect themselves against credit card fraud.

#credit card fraud detection #types of credit card fraud #contactless payment systems #technological challenges in credit card fraud #prevent fraudulent transactions in credit cards

How to Making A Simple Credit Card Validation form

In this quick tutorial we will show you how to create a simple credit card form. We'll build the whole thing from scratch, with a little help from Bootstrap 3 for the interface, and Payform.js for client-side form validation.

Project Overview

Here is a sneak-peak of what we will be building in this tutorial:


Credit Card Form Demo

You can get the full code for this project from the Download button near the top of the article. An overview of the files can be seen below:


There are two .css files and two .js files which we will need to include in our HTML. All other resources such as the Bootstrap framework, jQuery, and web fonts will be included externally via CDN.


<!DOCTYPE html>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Credit Card Validation Demo</title>

    <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="assets/css/styles.css">
    <link rel="stylesheet" type="text/css" href="assets/css/demo.css">


    <!-- The HTML for our form will go here -->

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="assets/js/jquery.payform.min.js" charset="utf-8"></script>
    <script src="assets/js/script.js"></script>

Now that everything is set up, we can start building our credit card form. Let's start with the HTML layout!


A credit card dialog needs to be simple, short, and straightforward. Here are the four input fields that every credit card form needs to have:

  • Credit card owner name
  • Card number
  • Secret code (also known as CVV/CVC/CID)
  • Expiration Date

All we need to do is create a <form> and add all the required input fields. For the owner, card number, and CVV we will use simple text fields. For the expiration date we'll put a combination of two selects with predefined options.

Besides that our form will have a heading, a submit button, and images for popular credit card vendors. Since we are working with Bootstrap there is a little extra markup, but it helps keep the code organized and the layout responsive.

<div class="creditCardForm">
    <div class="heading">
        <h1>Confirm Purchase</h1>
    <div class="payment">
            <div class="form-group owner">
                <label for="owner">Owner</label>
                <input type="text" class="form-control" id="owner">
            <div class="form-group CVV">
                <label for="cvv">CVV</label>
                <input type="text" class="form-control" id="cvv">
            <div class="form-group" id="card-number-field">
                <label for="cardNumber">Card Number</label>
                <input type="text" class="form-control" id="cardNumber">
            <div class="form-group" id="expiration-date">
                <label>Expiration Date</label>
                    <option value="01">January</option>
                    <option value="02">February </option>
                    <option value="03">March</option>
                    <option value="04">April</option>
                    <option value="05">May</option>
                    <option value="06">June</option>
                    <option value="07">July</option>
                    <option value="08">August</option>
                    <option value="09">September</option>
                    <option value="10">October</option>
                    <option value="11">November</option>
                    <option value="12">December</option>
                    <option value="16"> 2016</option>
                    <option value="17"> 2017</option>
                    <option value="18"> 2018</option>
                    <option value="19"> 2019</option>
                    <option value="20"> 2020</option>
                    <option value="21"> 2021</option>
            <div class="form-group" id="credit_cards">
                <img src="assets/images/visa.jpg" id="visa">
                <img src="assets/images/mastercard.jpg" id="mastercard">
                <img src="assets/images/amex.jpg" id="amex">
            <div class="form-group" id="pay-now">
                <button type="submit" class="btn btn-default" id="confirm-purchase">Confirm</button>

Now that we have the needed input fields, we can setup the validation rules.


All of the validation we will show here is client side and done exclusively in the JavaScript. If it is HTML validation that you are interested in, check out this article.

To kick things off we will define all the jQuery selectors we will need:

var owner = $('#owner'),
    cardNumber = $('#cardNumber'),
    cardNumberField = $('#card-number-field'),
    CVV = $("#cvv"),
    mastercard = $("#mastercard"),
    confirmButton = $('#confirm-purchase'),
    visa = $("#visa"),
    amex = $("#amex");

Then, using Payform.js, we will turn our basic input fields into specialized input for credit card data. We simply need to call the right function and the library will automatically handle text formatting and maximum string length for us:

cardNumber.payform('formatCardNumber'); CVV.payform('formatCardCVC');

Next, we want to be able to give real-time feedback to users while they are typing in their card number. To do so we will write a simple function that does two things:

  1. Check if the current text in the field is а valid card number or not. Add appropriate coloring to the text field.
  2. Depending on the present input characters, see if the card is either Visa, MasterCard, or American Express. This is done using the payform.parseCardType() method.

Since we want to execute the above actions every time a new character is typed in, we will use the jQuery keyup() event listener.

cardNumber.keyup(function() {

    if ($.payform.validateCardNumber(cardNumber.val()) == false) {
    } else {

    if ($.payform.parseCardType(cardNumber.val()) == 'visa') {
    } else if ($.payform.parseCardType(cardNumber.val()) == 'amex') {
    } else if ($.payform.parseCardType(cardNumber.val()) == 'mastercard') {

There is one more thing we have to do and that is is check if all the field are holding valid data when the user tries to submit the form.

Name validation can be quite tricky. To keep this tutorial light, we won't be going into that subject, and we will only check if the input name is at least 5 characters long. Payform provides us with the needed methods for validating the rest of the form.

confirmButton.click(function(e) {

    var isCardValid = $.payform.validateCardNumber(cardNumber.val());
    var isCvvValid = $.payform.validateCardCVC(CVV.val());

    if(owner.val().length < 5){
        alert("Wrong owner name");
    } else if (!isCardValid) {
        alert("Wrong card number");
    } else if (!isCvvValid) {
        alert("Wrong CVV");
    } else {
        // Everything is correct. Add your form submission code here.
        alert("Everything is correct");

The above validation is for educational purposes only and shouldn't be used on commercial projects. Always include both client-side and server-side validation to your forms, especially when working with credit card data.


We are using Bootstrap, so most of the styling is done by the framework. Our CSS mostly covers the size of the input fields and various padding, margin and font tweaks.


.creditCardForm {
    max-width: 700px;
    background-color: #fff;
    margin: 100px auto;
    overflow: hidden;
    padding: 25px;
    color: #4c4e56;
.creditCardForm label {
    width: 100%;
    margin-bottom: 10px;
.creditCardForm .heading h1 {
    text-align: center;
    font-family: 'Open Sans', sans-serif;
    color: #4c4e56;
.creditCardForm .payment {
    float: left;
    font-size: 18px;
    padding: 10px 25px;
    margin-top: 20px;
    position: relative;
.creditCardForm .payment .form-group {
    float: left;
    margin-bottom: 15px;
.creditCardForm .payment .form-control {
    line-height: 40px;
    height: auto;
    padding: 0 16px;
.creditCardForm .owner {
    width: 63%;
    margin-right: 10px;
.creditCardForm .CVV {
    width: 35%;
.creditCardForm #card-number-field {
    width: 100%;
.creditCardForm #expiration-date {
    width: 49%;
.creditCardForm #credit_cards {
    width: 50%;
    margin-top: 25px;
    text-align: right;
.creditCardForm #pay-now {
    width: 100%;
    margin-top: 25px;
.creditCardForm .payment .btn {
    width: 100%;
    margin-top: 3px;
    font-size: 24px;
    background-color: #2ec4a5;
    color: white;
.creditCardForm .payment select {
    padding: 10px;
    margin-right: 15px;
.transparent {
    opacity: 0.2;
@media(max-width: 650px) {
    .creditCardForm .owner,
    .creditCardForm .CVV,
    .creditCardForm #expiration-date,
    .creditCardForm #credit_cards {
        width: 100%;
    .creditCardForm #credit_cards {
        text-align: left;

With this our Credit Card Validation Form is complete!

Original article source at: https://tutorialzine.com/

#validation #card 

Dev Express



This is image title

The Twitter card is a facility provided by Twitter for its user to share their photos, videos, articles, blogs, and media in a more eye-catching way. The Twitter card is something that allows you to share your media beyond the limit of 280 characters, to some extent.

#twitter card #what is twitter card #types of twitter card #summary card #summary card with large image #player card

Mike doctor

Mike doctor


The 6 TOP Credit Cards for Beginners (High Rewards) . HOT NEWS!!!

In this video, I’m going over the 6 BEST credit cards for beginners! All these cards have high cash back rewards, no annual fee, and great protection. If you’re deciding which credit card to get, this video will go over the benefits of these top 6 cards, and which situations each is best for.
If you aren’t using credit cards yet but you are looking to save money on each purchase, consider one of these cards. I’ve gone through the hundreds of credit cards out there and picked my favorite ones that honestly will save you a ton of money. Not only can you get some pretty big sign up bonuses, you can also get as much as 5% cash back on many purchases.

Optimally, you will start with one card and work your way up to multiple cards. This is because some cards are better for spending in different categories. They also offer different perks that can work well together.

If you’re looking for the best points ecosystem, I’d have to give it to Chase.
They offer the most flexible and valuable points, and I’ve been using my Chase points to travel for free over the last 5 years. They have some great sign up bonuses going on right now. My first credit card was with Chase, and it was the best decision I’ve made. I now have 7 Chase credit cards!

Hope you guys found this video helpful! I love credit cards and have benefitted so much from them. I want you guys to all do the same.

📺 The video in this post was made by Charlie Chang
The origin of the article: https://www.youtube.com/watch?v=Ygmqh6nyaRU
🔺 DISCLAIMER: The article is for information sharing. The content of this video is solely the opinions of the speaker who is not a licensed financial advisor or registered investment advisor. Not investment advice or legal advice.
Cryptocurrency trading is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
☞ **-----CLICK HERE-----**⭐ ⭐ ⭐
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!

#bitcoin #blockchain #credit card #top credit cards for beginners #the 6 top credit cards for beginners #high rewards

Rahul Jangid


What is JavaScript - Stackfindover - Blog

Who invented JavaScript, how it works, as we have given information about Programming language in our previous article ( What is PHP ), but today we will talk about what is JavaScript, why JavaScript is used The Answers to all such questions and much other information about JavaScript, you are going to get here today. Hope this information will work for you.

Who invented JavaScript?

JavaScript language was invented by Brendan Eich in 1995. JavaScript is inspired by Java Programming Language. The first name of JavaScript was Mocha which was named by Marc Andreessen, Marc Andreessen is the founder of Netscape and in the same year Mocha was renamed LiveScript, and later in December 1995, it was renamed JavaScript which is still in trend.

What is JavaScript?

JavaScript is a client-side scripting language used with HTML (Hypertext Markup Language). JavaScript is an Interpreted / Oriented language called JS in programming language JavaScript code can be run on any normal web browser. To run the code of JavaScript, we have to enable JavaScript of Web Browser. But some web browsers already have JavaScript enabled.

Today almost all websites are using it as web technology, mind is that there is maximum scope in JavaScript in the coming time, so if you want to become a programmer, then you can be very beneficial to learn JavaScript.

JavaScript Hello World Program

In JavaScript, ‘document.write‘ is used to represent a string on a browser.

<script type="text/javascript">
	document.write("Hello World!");

How to comment JavaScript code?

  • For single line comment in JavaScript we have to use // (double slashes)
  • For multiple line comments we have to use / * – – * /
<script type="text/javascript">

//single line comment

/* document.write("Hello"); */


Advantages and Disadvantages of JavaScript

#javascript #javascript code #javascript hello world #what is javascript #who invented javascript