JQuery Payment
How do I make an jquery payment?
Auto formatting input fields for a better payment UX. What is a jquery payment? How do you make a jquery payment? This script and codes were developed by Andres on 14 January 2023, Saturday.
JQuery Payment - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>jQuery Payment</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ @import url("https://fonts.googleapis.com/css?family=Open+Sans:400,600");
@import url("https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css");
* { margin: 0; padding: 0; box-sizing: border-box;
}
html, body { height: 100%;
}
body { font: 16px/1 'Open Sans', sans-serif; color: #555; background: #ddd;
}
.title { padding: 35px 0 40px; text-align: center;
}
.title span { display: block; margin: 0 0 15px; font-size: 30px;
}
.payment { width: 500px; margin: 0 auto; padding: 35px 0; border-top: 1px solid #aaa; border-bottom: 1px solid #aaa;
}
[placeholder]::-webkit-input-placeholder { color: rgba(0, 0, 0, 0.3);
}
[placeholder]:hover::-webkit-input-placeholder { color: rgba(0, 0, 0, 0.15);
}
[placeholder]:focus::-webkit-input-placeholder { color: transparent;
}
[placeholder]::-moz-placeholder { color: rgba(0, 0, 0, 0.3);
}
[placeholder]:hover::-moz-placeholder { color: rgba(0, 0, 0, 0.15);
}
[placeholder]:focus::-moz-placeholder { color: transparent;
}
[placeholder]:-ms-input-placeholder { color: rgba(0, 0, 0, 0.3);
}
[placeholder]:hover:-ms-input-placeholder { color: rgba(0, 0, 0, 0.15);
}
[placeholder]:focus:-ms-input-placeholder { color: transparent;
}
button::-moz-focus-inner,
input::-moz-focus-inner { border: 0; padding: 0;
}
label, input, button { display: block; width: 200px; margin: 0 auto 10px;
}
label { font-size: 13px; font-weight: 600; color: #777;
}
input { padding: 10px 15px; font-size: 14px; color: inherit; border: 1px solid #aaa; outline: 0;
}
button { padding: 10px 15px; font-size: 14px; font-weight: 600; color: #fff; border: 0; border-bottom: 3px solid #37b; background: #48c;
}
input.invalid { border: 1px solid red;
}
.validation.failed:after { color: red; content: 'Validation failed';
}
.validation.passed:after { color: green; content: 'Validation passed';
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js'></script>
<script src='https://stripe.github.io/jquery.payment/lib/jquery.payment.js'></script>
<div class="title"> <span>jQuery Payment</span> auto formatting input fields for a better payment UX
</div>
<div class="payment"> <form novalidate autocomplete="on"> <label>Card number:</label> <input type="text" class="cc-number" pattern="\d*" x-autocompletetype="cc-number" placeholder="•••• •••• •••• ••••" required /> <label>Expires:</label> <input type="text" class="cc-exp" pattern="\d*" x-autocompletetype="cc-exp" placeholder="MM / YYYY" required maxlength="9" /> <label>CVC:</label> <input type="text" class="cc-cvc" pattern="\d*" x-autocompletetype="cc-csc" placeholder="123" required maxlength="4" autocomplete="off" /> <label class="validation"></label> <button type="submit">Submit</button> </form>
</div> <script src="js/index.js"></script>
</body>
</html>
JQuery Payment - Script Codes CSS Codes
@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,600");
@import url("https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css");
* { margin: 0; padding: 0; box-sizing: border-box;
}
html, body { height: 100%;
}
body { font: 16px/1 'Open Sans', sans-serif; color: #555; background: #ddd;
}
.title { padding: 35px 0 40px; text-align: center;
}
.title span { display: block; margin: 0 0 15px; font-size: 30px;
}
.payment { width: 500px; margin: 0 auto; padding: 35px 0; border-top: 1px solid #aaa; border-bottom: 1px solid #aaa;
}
[placeholder]::-webkit-input-placeholder { color: rgba(0, 0, 0, 0.3);
}
[placeholder]:hover::-webkit-input-placeholder { color: rgba(0, 0, 0, 0.15);
}
[placeholder]:focus::-webkit-input-placeholder { color: transparent;
}
[placeholder]::-moz-placeholder { color: rgba(0, 0, 0, 0.3);
}
[placeholder]:hover::-moz-placeholder { color: rgba(0, 0, 0, 0.15);
}
[placeholder]:focus::-moz-placeholder { color: transparent;
}
[placeholder]:-ms-input-placeholder { color: rgba(0, 0, 0, 0.3);
}
[placeholder]:hover:-ms-input-placeholder { color: rgba(0, 0, 0, 0.15);
}
[placeholder]:focus:-ms-input-placeholder { color: transparent;
}
button::-moz-focus-inner,
input::-moz-focus-inner { border: 0; padding: 0;
}
label, input, button { display: block; width: 200px; margin: 0 auto 10px;
}
label { font-size: 13px; font-weight: 600; color: #777;
}
input { padding: 10px 15px; font-size: 14px; color: inherit; border: 1px solid #aaa; outline: 0;
}
button { padding: 10px 15px; font-size: 14px; font-weight: 600; color: #fff; border: 0; border-bottom: 3px solid #37b; background: #48c;
}
input.invalid { border: 1px solid red;
}
.validation.failed:after { color: red; content: 'Validation failed';
}
.validation.passed:after { color: green; content: 'Validation passed';
}
JQuery Payment - Script Codes JS Codes
jQuery(function($){ $('.cc-number').payment('formatCardNumber'); $('.cc-exp').payment('formatCardExpiry'); $('.cc-cvc').payment('formatCardCVC'); $('form').submit(function(e){ e.preventDefault(); $('input').removeClass('invalid'); $('.validation').removeClass('passed failed'); var cardType = $.payment.cardType($('.cc-number').val()); $('.cc-number').toggleClass('invalid', !$.payment.validateCardNumber($('.cc-number').val())); $('.cc-exp').toggleClass('invalid', !$.payment.validateCardExpiry($('.cc-exp').payment('cardExpiryVal'))); $('.cc-cvc').toggleClass('invalid', !$.payment.validateCardCVC($('.cc-cvc').val(), cardType)); if ( $('input.invalid').length ) { $('.validation').addClass('failed'); } else { $('.validation').addClass('passed'); } });
});
Developer | Andres |
Username | Angelfire |
Uploaded | January 14, 2023 |
Rating | 3 |
Size | 4,158 Kb |
Views | 4,048 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Angular responsive comment system | 7,439 Kb |
Flexbox Admin Template | 4,741 Kb |
Threaded Chat | 3,525 Kb |
Social Media Button | 3,566 Kb |
Vue 2.0 Intro | 1,776 Kb |
Array vs object | 3,043 Kb |
Simple Dashboard Search | 4,595 Kb |
Weather App | 4,531 Kb |
Latest Posts Widget | 3,059 Kb |
Swanky Pure CSS Drop Down Menu V2.0 | 7,247 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
CSS3 Media Queries demo | Machal | 1,824 Kb |
Comment Jquery | SquishyAndroid | 2,421 Kb |
A Pen by Tosh | Panev | 2,586 Kb |
Z-index demo | Kblh | 1,534 Kb |
Import shader in three.js | Khangeldy | 2,636 Kb |
Twitch TV | Natester13 | 4,488 Kb |
Old calculator | Gnarfugh | 2,815 Kb |
Expert Help | SinceSidSlid | 4,064 Kb |
Responsive Menu I | Rodericksandoval | 3,045 Kb |
CSS Colors | Alexpate | 2,232 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!