"Form - Line"
Bootstrap 4.1.1 Snippet by pablocorezzola

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
<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 ---------->
<link href="https://fonts.googleapis.com/css?family=Libre+Franklin" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css">
<div style="display:flex;width:100%;">
<form>
<div style="width:100%;">
<p>FULL NAME</p>
<input name="name" autofocus>
</div>
<div style="width:100%;">
<p>IDENTIFICATION</p>
<input name="id">
</div>
<div style="width:47%;">
<p>EMAIL</p>
<input name="email">
</div>
<div style="width:47%;margin-left:6%">
<p>PHONE</p>
<input name="phone">
</div>
<p class="term">
<i class="fa fa-check-square-o" aria-hidden="true"></i><span>Acepto términos y condiciones. </span>
</p>
<p>
<a>CONTINUE</a>
</p>
<a>by pablo_corezzola</a>
</form>
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
body{
padding:25px;
}
input:focus{
outline: none;
}
form{
width: 35%;
margin-left:auto;
margin-right:auto;
padding:50px;
background:whitesmoke;
border-radius:5px;
position:relative;
font-family: 'Libre Franklin', sans-serif;
}
form > div {
float:left;margin-bottom:30px;
}
form > div > p{
font-size: 12px;margin-bottom: 3px;
}
form > div > input{
font-size:12px;letter-spacing:1px;padding: 5px;border: 0;background: whitesmoke;border-bottom: 1px solid silver;width: 100%;color: gray;
}
form > p:last-of-type{
text-align: center;padding-top: 50px;display: table;width: 100%;color:white;
}
form > p:last-of-type > a{
cursor:pointer;border:0;
padding: 10px 25px;
background: silver;
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
$(document).ready(function(){
//-- Click on terms and conditions
$(".term").click(function(){
var ctrl = $(this).find("i");
if (ctrl.hasClass("fa-check-square-o")){
ctrl.attr("class","fa fa-square-o");
}else{
ctrl.attr("class", "fa fa-check-square-o");
}
})
$("input").blur(function(){
if ($(this).val() != ""){
$(this).parent().css({"color":"black"});
$(this).css({"border-bottom":"1px solid silver","color":"gray"});
}
})
//--- CONTINUE ---
$("form > p > a").click(function(){
//-- Detect terms and conditions
var term = false;
if ($(".term > i").hasClass('fa-check-square-o')){
term = true;
}
//-- only example
var user = {};
user.name = $("input[name='name']").val();
user.id = $("input[name='id']").val();
user.phone = $("input[name='phone']").val();
user.email = $("input[name='email']").val();
user.term = term;
//-- Validator
$("input").each(function(e, valor){
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: