-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmulti-step-form-with-international-phone-input and-nice-select.html
More file actions
575 lines (562 loc) · 18.3 KB
/
Copy pathmulti-step-form-with-international-phone-input and-nice-select.html
File metadata and controls
575 lines (562 loc) · 18.3 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Multi Step Form with Progress Bar Example </title>
<!-- Normalize CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<!-- Bootstrap 4 CSS -->
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.2/css/bootstrap.css'>
<!-- Telephone Input CSS -->
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/12.1.2/css/intlTelInput.css'>
<!-- Icons CSS -->
<link rel='stylesheet' href='https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css'>
<!-- Nice Select CSS -->
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/jquery-nice-select/1.1.0/css/nice-select.min.css'>
<!-- Style CSS -->
<style>
/*font Variables*/
/*Color Variables*/
@import url("https://fonts.googleapis.com/css?family=Roboto:300i,400,400i,500,700,900");
.multi_step_form {
background: #f6f9fb;
display: block;
overflow-x: hidden;
}
.multi_step_form #msform {
text-align: center;
position: relative;
padding-top: 50px;
min-height: 820px;
height: auto;
max-width: 820px;
margin: 0 auto;
background: #ffffff;
z-index: 1;
}
.multi_step_form #msform .tittle {
text-align: center;
padding-bottom: 55px;
}
.multi_step_form #msform .tittle h2 {
font: 500 24px/35px "Roboto", sans-serif;
color: #3f4553;
padding-bottom: 5px;
}
.multi_step_form #msform .tittle p {
font: 400 16px/28px "Roboto", sans-serif;
color: #5f6771;
}
.multi_step_form #msform fieldset {
border: 0;
padding: 20px 105px 0;
position: relative;
width: 100%;
left: 0;
right: 0;
}
.multi_step_form #msform fieldset:not(:first-of-type) {
display: none;
}
.multi_step_form #msform fieldset h3 {
font: 500 18px/35px "Roboto", sans-serif;
color: #3f4553;
}
.multi_step_form #msform fieldset h6 {
font: 400 15px/28px "Roboto", sans-serif;
color: #5f6771;
padding-bottom: 30px;
}
.multi_step_form #msform fieldset .intl-tel-input {
display: block;
background: transparent;
border: 0;
box-shadow: none;
outline: none;
}
.multi_step_form #msform fieldset .intl-tel-input .flag-container .selected-flag {
padding: 0 20px;
background: transparent;
border: 0;
box-shadow: none;
outline: none;
width: 65px;
}
.multi_step_form #msform fieldset .intl-tel-input .flag-container .selected-flag .iti-arrow {
border: 0;
}
.multi_step_form #msform fieldset .intl-tel-input .flag-container .selected-flag .iti-arrow:after {
content: "\f35f";
position: absolute;
top: 0;
right: 0;
font: normal normal normal 24px/7px Ionicons;
color: #5f6771;
}
.multi_step_form #msform fieldset #phone {
padding-left: 80px;
}
.multi_step_form #msform fieldset .form-group {
padding: 0 10px;
}
.multi_step_form #msform fieldset .fg_2, .multi_step_form #msform fieldset .fg_3 {
padding-top: 10px;
display: block;
overflow: hidden;
}
.multi_step_form #msform fieldset .fg_3 {
padding-bottom: 70px;
}
.multi_step_form #msform fieldset .form-control, .multi_step_form #msform fieldset .product_select {
border-radius: 3px;
border: 1px solid #d8e1e7;
padding: 0 20px;
height: auto;
font: 400 15px/48px "Roboto", sans-serif;
color: #5f6771;
box-shadow: none;
outline: none;
width: 100%;
}
.multi_step_form #msform fieldset .form-control.placeholder, .multi_step_form #msform fieldset .product_select.placeholder {
color: #5f6771;
}
.multi_step_form #msform fieldset .form-control:-moz-placeholder, .multi_step_form #msform fieldset .product_select:-moz-placeholder {
color: #5f6771;
}
.multi_step_form #msform fieldset .form-control::-moz-placeholder, .multi_step_form #msform fieldset .product_select::-moz-placeholder {
color: #5f6771;
}
.multi_step_form #msform fieldset .form-control::-webkit-input-placeholder, .multi_step_form #msform fieldset .product_select::-webkit-input-placeholder {
color: #5f6771;
}
.multi_step_form #msform fieldset .form-control:hover, .multi_step_form #msform fieldset .form-control:focus, .multi_step_form #msform fieldset .product_select:hover, .multi_step_form #msform fieldset .product_select:focus {
border-color: #5271ff;
}
.multi_step_form #msform fieldset .form-control:focus.placeholder, .multi_step_form #msform fieldset .product_select:focus.placeholder {
color: transparent;
}
.multi_step_form #msform fieldset .form-control:focus:-moz-placeholder, .multi_step_form #msform fieldset .product_select:focus:-moz-placeholder {
color: transparent;
}
.multi_step_form #msform fieldset .form-control:focus::-moz-placeholder, .multi_step_form #msform fieldset .product_select:focus::-moz-placeholder {
color: transparent;
}
.multi_step_form #msform fieldset .form-control:focus::-webkit-input-placeholder, .multi_step_form #msform fieldset .product_select:focus::-webkit-input-placeholder {
color: transparent;
}
.multi_step_form #msform fieldset .product_select:after {
display: none;
}
.multi_step_form #msform fieldset .product_select:before {
content: "\f35f";
position: absolute;
top: 0;
right: 20px;
font: normal normal normal 24px/48px Ionicons;
color: #5f6771;
}
.multi_step_form #msform fieldset .product_select .list {
width: 100%;
}
.multi_step_form #msform fieldset .done_text {
padding-top: 40px;
}
.multi_step_form #msform fieldset .done_text .don_icon {
height: 36px;
width: 36px;
line-height: 36px;
font-size: 22px;
margin-bottom: 10px;
background: #5271ff;
display: inline-block;
border-radius: 50%;
color: #ffffff;
text-align: center;
}
.multi_step_form #msform fieldset .done_text h6 {
line-height: 23px;
}
.multi_step_form #msform fieldset .code_group {
margin-bottom: 60px;
}
.multi_step_form #msform fieldset .code_group .form-control {
border: 0;
border-bottom: 1px solid #a1a7ac;
border-radius: 0;
display: inline-block;
width: 30px;
font-size: 30px;
color: #5f6771;
padding: 0;
margin-right: 7px;
text-align: center;
line-height: 1;
}
.multi_step_form #msform fieldset .passport {
margin-top: -10px;
padding-bottom: 30px;
position: relative;
}
.multi_step_form #msform fieldset .passport .don_icon {
height: 36px;
width: 36px;
line-height: 36px;
font-size: 22px;
position: absolute;
top: 4px;
right: 0;
background: #5271ff;
display: inline-block;
border-radius: 50%;
color: #ffffff;
text-align: center;
}
.multi_step_form #msform fieldset .passport h4 {
font: 500 15px/23px "Roboto", sans-serif;
color: #5f6771;
padding: 0;
}
.multi_step_form #msform fieldset .input-group {
padding-bottom: 40px;
}
.multi_step_form #msform fieldset .input-group .custom-file {
width: 100%;
height: auto;
}
.multi_step_form #msform fieldset .input-group .custom-file .custom-file-label {
width: 168px;
border-radius: 5px;
cursor: pointer;
font: 700 14px/40px "Roboto", sans-serif;
border: 1px solid #99a2a8;
text-align: center;
transition: all 300ms linear 0s;
color: #5f6771;
}
.multi_step_form #msform fieldset .input-group .custom-file .custom-file-label i {
font-size: 20px;
padding-right: 10px;
}
.multi_step_form #msform fieldset .input-group .custom-file .custom-file-label:hover, .multi_step_form #msform fieldset .input-group .custom-file .custom-file-label:focus {
background: #5271ff;
border-color: #5271ff;
color: #fff;
}
.multi_step_form #msform fieldset .input-group .custom-file input {
display: none;
}
.multi_step_form #msform fieldset .file_added {
text-align: left;
padding-left: 190px;
padding-bottom: 60px;
}
.multi_step_form #msform fieldset .file_added li {
font: 400 15px/28px "Roboto", sans-serif;
color: #5f6771;
}
.multi_step_form #msform fieldset .file_added li a {
color: #5271ff;
font-weight: 500;
display: inline-block;
position: relative;
padding-left: 15px;
}
.multi_step_form #msform fieldset .file_added li a i {
font-size: 22px;
padding-right: 8px;
position: absolute;
left: 0;
transform: rotate(20deg);
}
.multi_step_form #msform #progressbar {
margin-bottom: 30px;
overflow: hidden;
}
.multi_step_form #msform #progressbar li {
list-style-type: none;
color: #99a2a8;
font-size: 9px;
width: calc(100%/3);
float: left;
position: relative;
font: 500 13px/1 "Roboto", sans-serif;
}
.multi_step_form #msform #progressbar li:nth-child(2):before {
content: "\f12f";
}
.multi_step_form #msform #progressbar li:nth-child(3):before {
content: "\f457";
}
.multi_step_form #msform #progressbar li:before {
content: "\f1fa";
font: normal normal normal 30px/50px Ionicons;
width: 50px;
height: 50px;
line-height: 50px;
display: block;
background: #eaf0f4;
border-radius: 50%;
margin: 0 auto 10px auto;
}
.multi_step_form #msform #progressbar li:after {
content: '';
width: 100%;
height: 10px;
background: #eaf0f4;
position: absolute;
left: -50%;
top: 21px;
z-index: -1;
}
.multi_step_form #msform #progressbar li:last-child:after {
width: 150%;
}
.multi_step_form #msform #progressbar li.active {
color: #5271ff;
}
.multi_step_form #msform #progressbar li.active:before, .multi_step_form #msform #progressbar li.active:after {
background: #5271ff;
color: white;
}
.multi_step_form #msform .action-button {
background: #5271ff;
color: white;
border: 0 none;
border-radius: 5px;
cursor: pointer;
min-width: 130px;
font: 700 14px/40px "Roboto", sans-serif;
border: 1px solid #5271ff;
margin: 0 5px;
text-transform: uppercase;
display: inline-block;
}
.multi_step_form #msform .action-button:hover, .multi_step_form #msform .action-button:focus {
background: #405867;
border-color: #405867;
}
.multi_step_form #msform .previous_button {
background: transparent;
color: #99a2a8;
border-color: #99a2a8;
}
.multi_step_form #msform .previous_button:hover, .multi_step_form #msform .previous_button:focus {
background: #405867;
border-color: #405867;
color: #fff;
}
</style>
</head>
<body>
<main>
<article>
<!-- Start Multiform HTML -->
<section class="multi_step_form">
<form id="msform">
<!-- Tittle -->
<div class="tittle">
<h2>Verification Process</h2>
<p>In order to use this service, you have to complete this verification process</p>
</div>
<!-- progressbar -->
<ul id="progressbar">
<li class="active">Verify Phone</li>
<li>Upload Documents</li>
<li>Security Questions</li>
</ul>
<!-- fieldsets -->
<fieldset>
<h3>Setup your phone</h3>
<h6>We will send you a SMS. Input the code to verify.</h6>
<div class="form-row">
<div class="form-group col-md-6">
<input type="tel" id="phone" class="form-control" placeholder="+91">
</div>
<div class="form-group col-md-6">
<input type="text" class="form-control" placeholder="Enter Number">
</div>
</div>
<div class="done_text">
<a href="#" class="don_icon"><i class="ion-android-done"></i></a>
<h6>A secret code is sent to your phone. <br>Please enter it here.</h6>
</div>
<div class="code_group">
<input type="text" class="form-control" placeholder="0">
<input type="text" class="form-control" placeholder="0">
<input type="text" class="form-control" placeholder="0">
<input type="text" class="form-control" placeholder="0">
</div>
<button type="button" class="action-button previous_button">Back</button>
<button type="button" class="next action-button">Continue</button>
</fieldset>
<fieldset>
<h3>Verify Your Identity</h3>
<h6>Please upload any of these documents to verify your Identity.</h6>
<div class="passport">
<h4>Govt. ID card <br>PassPort <br>Driving License.</h4>
<a href="#" class="don_icon"><i class="ion-android-done"></i></a>
</div>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" id="upload">
<label class="custom-file-label" for="upload"><i class="ion-android-cloud-outline"></i>Choose file</label>
</div>
</div>
<ul class="file_added">
<li>File Added:</li>
<li><a href="#"><i class="ion-paperclip"></i>national_id_card.png</a></li>
<li><a href="#"><i class="ion-paperclip"></i>national_id_card_back.png</a></li>
</ul>
<button type="button" class="action-button previous previous_button">Back</button>
<button type="button" class="next action-button">Continue</button>
</fieldset>
<fieldset>
<h3>Create Security Questions</h3>
<h6>Please update your account with security questions</h6>
<div class="form-group">
<select class="product_select">
<option data-display="1. Choose A Question">1. Choose A Question</option>
<option>2. Choose A Question</option>
<option>3. Choose A Question</option>
</select>
</div>
<div class="form-group fg_2">
<input type="text" class="form-control" placeholder="Anwser here:">
</div>
<div class="form-group">
<select class="product_select">
<option data-display="1. Choose A Question">1. Choose A Question</option>
<option>2. Choose A Question</option>
<option>3. Choose A Question</option>
</select>
</div>
<div class="form-group fg_3">
<input type="text" class="form-control" placeholder="Anwser here:">
</div>
<button type="button" class="action-button previous previous_button">Back</button>
<a href="#" class="action-button">Finish</a>
</fieldset>
</form>
</section>
<!-- END Multiform HTML -->
</article>
</main>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/js/bootstrap.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/12.1.2/js/intlTelInput.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery-nice-select/1.1.0/js/jquery.nice-select.min.js'></script>
<script>
(function($) {
"use strict";
//* Form js
function verificationForm(){
//jQuery time
var current_fs, next_fs, previous_fs; //fieldsets
var left, opacity, scale; //fieldset properties which we will animate
var animating; //flag to prevent quick multi-click glitches
$(".next").click(function () {
if (animating) return false;
animating = true;
current_fs = $(this).parent();
next_fs = $(this).parent().next();
//activate next step on progressbar using the index of next_fs
$("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active");
//show the next fieldset
next_fs.show();
//hide the current fieldset with style
current_fs.animate({
opacity: 0
}, {
step: function (now, mx) {
//as the opacity of current_fs reduces to 0 - stored in "now"
//1. scale current_fs down to 80%
scale = 1 - (1 - now) * 0.2;
//2. bring next_fs from the right(50%)
left = (now * 50) + "%";
//3. increase opacity of next_fs to 1 as it moves in
opacity = 1 - now;
current_fs.css({
'transform': 'scale(' + scale + ')',
'position': 'absolute'
});
next_fs.css({
'left': left,
'opacity': opacity
});
},
duration: 800,
complete: function () {
current_fs.hide();
animating = false;
},
//this comes from the custom easing plugin
easing: 'easeInOutBack'
});
});
$(".previous").click(function () {
if (animating) return false;
animating = true;
current_fs = $(this).parent();
previous_fs = $(this).parent().prev();
//de-activate current step on progressbar
$("#progressbar li").eq($("fieldset").index(current_fs)).removeClass("active");
//show the previous fieldset
previous_fs.show();
//hide the current fieldset with style
current_fs.animate({
opacity: 0
}, {
step: function (now, mx) {
//as the opacity of current_fs reduces to 0 - stored in "now"
//1. scale previous_fs from 80% to 100%
scale = 0.8 + (1 - now) * 0.2;
//2. take current_fs to the right(50%) - from 0%
left = ((1 - now) * 50) + "%";
//3. increase opacity of previous_fs to 1 as it moves in
opacity = 1 - now;
current_fs.css({
'left': left
});
previous_fs.css({
'transform': 'scale(' + scale + ')',
'opacity': opacity
});
},
duration: 800,
complete: function () {
current_fs.hide();
animating = false;
},
//this comes from the custom easing plugin
easing: 'easeInOutBack'
});
});
$(".submit").click(function () {
return false;
})
};
//* Add Phone no select
function phoneNoselect(){
if ( $('#msform').length ){
$("#phone").intlTelInput();
$("#phone").intlTelInput("setNumber", "+91");
};
};
//* Select js
function nice_Select(){
if ( $('.product_select').length ){
$('select').niceSelect();
};
};
/*Function Calls*/
verificationForm ();
phoneNoselect ();
nice_Select ();
})(jQuery);
</script>
</body>
</html>