"Untitled"
Bootstrap 4.1.1 Snippet by krunb

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row">
<div class="col-md-12 mx-auto">
<div class="pin-wrapper v-code d-flex mt-5" dir="ltr">
<input type="tel" id="phone1" name="code1" data-role="pin" class="pin-input" required autocomplete="off" autofocus style="text-align: center !important;">
<input type="tel" id="phone2" name="code2" data-role="pin" class="pin-input" required autocomplete="off" style="text-align: center !important;">
<input type="tel" id="phone3" name="code3" data-role="pin" class="pin-input" required autocomplete="off" style="text-align: center !important;">
<input type="tel" id="phone4" name="code4" data-role="pin" class="pin-input" required autocomplete="off" style="text-align: center !important;">
</div>
</div>
</div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(function($) {
//Declare our function
$.fn.validatePin = function(options) {
var defaults = {
//Default Settings
numericKeyboardOnMobile: false,
blurOnSuccess: false,
//Declaring our callback functions
onSuccess: function() {},
onFailure: function() {}
};
var settings = $.extend({}, defaults, options);
//Cache the DOM into a jquery object so that repetitive scanning of DOM won't be necessary
var $wrapper = $(this),
$el = $wrapper.find('[data-role="pin"]'),
$elCount = $wrapper.find('[data-role="pin"]').length;
pin = "";
$el.each(function() {
pin += ".";
});
//Event Initializations
bindEvents();
//Function Declarations
function bindEvents() {
$($el).on("focus", function() {
selectText(this);
});
if (checkForMobileDevices()) {
$($el).on("keyup", function(e) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: