"input form"
Bootstrap 3.0.0 Snippet by evarevirus

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html><html lang='en' class=''> <head><script src='//production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/drew_mc/pen/JoZVdE?depth=everything&order=popularity&page=21&q=input&show_forks=false" /> <link rel='stylesheet prefetch' href='//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css'> <style class="cp-pen-styles">body { background-color: #34364a; margin: 0; font-family: 'Lato', sans-serif; } body.light { background-color: #e5e8ea; } form { width: 470px; margin: 5em auto; border: none; } form fieldset { margin: 0; padding: 0; border: 0; } form .input-wrapper { border: 1px solid #ea5662; background-color: rgba(255, 255, 255, 0.8); padding: 0; margin: 5px 0 0; position: relative; height: 2.5em; -webkit-transition: all 100ms ease-in 50ms; transition: all 100ms ease-in 50ms; } form .input-wrapper.last { border-bottom: 1px solid #ea5662; } form .input-wrapper.focus { background-color: white; } form label { background-color: #ea5662; position: absolute; color: #eee; font-weight: 400; font-size: 0.75em; text-transform: uppercase; letter-spacing: 2px; display: inline-block; padding: 1em 1.5em; box-sizing: border-box; width: 170px; top: 0; left: 0; margin: 0; height: 3.3em; } form input[type=text] { position: absolute; font-family: 'Lato', sans-serif; left: 170px; top: -4px; border: none; background-color: transparent; display: inline-block; font-size: 0.9em; margin-top: 4px; height: 1.3em; padding: 0.68em 1.5em; width: 200px; outline: none; color: #34364a; font-weight: 100; letter-spacing: 1px; } form button { float: right; background-color: transparent; width: 20px; height: 20px; text-indent: -999em; color: transparent; border: none; margin: .9em 1.3em .55em 0.2em; outline: none; } form button.icon-edit { background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/78060/edit.svg"); margin-top: 0.8em; } form button.icon-add { background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/78060/add.svg"); width: 18px; height: 18px; margin-right: 1.5em; } form button.icon-save { background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/78060/save.svg"); margin-right: 1.35em; margin-top: 0.75em; width: 22px; height: 22px; } form button.icon-cancel { background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/78060/close.svg"); width: 17px; height: 17px; margin-top: 1em; margin-right: 1.5em; } form ::-webkit-input-placeholder { font-style: italic; font-weight: 100; } form :-moz-placeholder { font-style: italic; font-weight: 100; } form ::-moz-placeholder { font-style: italic; font-weight: 100; } form :-ms-input-placeholder { font-style: italic; font-weight: 100; } form input:focus::-webkit-input-placeholder { color: transparent; } form input:focus:-moz-placeholder { color: transparent; } form input:focus::-moz-placeholder { color: transparent; } form input:focus:-ms-input-placeholder { color: transparent; } </style></head><body> <link href='https://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'> <form autocomplete="off"> <fieldset> <div class="input-wrapper add-value"> <label for="test_mobile_user">Username</label> <input placeholder="No username listed" type="text" name="test_mobile_user" id="test_mobile_user" value="drew_mc"> <div class="add-controls clearfix"> <button class="icon-edit tooltip tooltipstered">Edit</button> <button class="icon-add tooltip tooltipstered">Add</button> <button class="icon-cancel tooltip tooltipstered">Cancel</button> <button class="icon-save tooltip tooltipstered">Save</button> </div> </div> </fieldset> <fieldset> <div class="input-wrapper last add-value"> <label for="test_mobile_pw">Email Address</label> <input placeholder="No email listed." type="text" name="test_mobile_pw" id="test_mobile_pw" value=""> <div class="add-controls clearfix"> <button class="icon-edit tooltip tooltipstered">Edit</button> <button class="icon-add tooltip tooltipstered">Add</button> <button class="icon-cancel tooltip tooltipstered">Cancel</button> <button class="icon-save tooltip tooltipstered">Save</button> </div> </div> </fieldset> </form> <script src='//production-assets.codepen.io/assets/common/stopExecutionOnTimeout-b2a7b3fe212eaa732349046d8416e00a9dec26eb7fd347590fbced3ab38af52e.js'></script><script src='//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script><script src='//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script> <script >$(".icon-save , .icon-cancel").hide(); $(document).ready(function(){ $('input').focus(function(){ $('input').parent().removeClass("focus"); $(this).parent().toggleClass( "focus" ); $(this).siblings().children(".icon-edit, .icon-add").fadeOut(20); $(this).siblings().children(".icon-cancel").delay(200).fadeIn(100); }); if( $("input#test_mobile_user").val() === "" ){ $("input#test_mobile_user").siblings().children(".icon-edit").hide(); } else { $("input#test_mobile_user").siblings().children(".icon-add").hide(); } if ( $("input#test_mobile_pw").val() === "" ){ $("input#test_mobile_pw").siblings().children(".icon-edit").hide(); } else { $("input#test_mobile_pw").siblings().children(".icon-add").hide(); } $("input").keyup(function(){ $(this).siblings().children('.icon-cancel').fadeOut("fast"); $(this).siblings().children('.icon-save').delay(200).fadeIn("fast"); }); $('.icon-edit, .icon-add').on("click",function(){ event.preventDefault(); $(this).parent().siblings("input").focus(); $(this).closest("div").parent().addClass("focus"); $(this).siblings(".icon-cancel").delay(200).fadeIn(100); }); $('.icon-save, .icon-cancel').on("click",function(){ event.preventDefault(); $(this).fadeOut("fast", function(){ if( $(this).parent().siblings("input").val() === "" ){ $(this).siblings(".icon-add").fadeIn("fast"); } else { $(this).siblings(".icon-edit").fadeIn("fast"); } }); }); $(this).click(function (e) { if( ($(".input-wrapper").is(".focus") && !$("input, .icon-edit, .icon-add").is(e.target)) ) { $(".focus").removeClass("focus"); } }); }); //# sourceURL=pen.js </script> </body></html>

Related: See More


Questions / Comments: