Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Form - Line"
Bootstrap 4.1.1 Snippet by
pablocorezzola
4.1.1
jQuery
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
27.1K
 
11 Fav
Post to Facebook
Tweet this
<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> </div>
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; border-radius: 28px; font-size: 12px; } .term{ padding-top:40px;display: flex;width: 100%;align-items: center; } .term > i{ cursor:pointer;width:20px; } .term > span{ font-size:12px; } /* delete */ form > a:last-of-type{ position:absolute; bottom: 10px; right: 15px; font-size: 10px; letter-spacing: 1px; font-style: italic; }
$(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){ var error = false; if ($(this).val() == ""){ error = true; } if (error === true){ //-- with errors $(this).parent().css({"color":"red"}); $(this).css({"border-bottom":"1px solid red"}); }else{ //-- without errors $(this).parent().css({"color":"black"}); $(this).css({"border-bottom":"1px solid silver","color":"gray"}); } }) //-- msg example $("body").append(JSON.stringify(user) + "<br>"); }) })
Related:
See More
Free Template
Material Kit
462.9K
45
login-form
170.7K
18
Login Form
142.0K
51
Contact Form
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76