Тоячняк забыл что так надо указывать
Я тут завершил ребята делюсь своими наработками как делать современную форму регистрации
<form id="shablon_registration_1">
<div class="form_input" id="form-input-1" iid="1">
<label>Имя</label>
<input id="form_input_input-1" type="text" name="" oninput="formoninput(1)"/>
<span class="err"></span>
</div>
<div class="form_input" id="form-input-2" iid="2">
<label>Фамилия</label>
<input id="form_input_input-2" type="text" name="" iid="2" oninput="formoninput(2)"/>
<span class="err"></span>
</div>
<div class="form_input" id="form-input-3" iid="3">
<label>Фамилия</label>
<input id="form_input_input-3" type="text" name="" iid="3" oninput="formoninput(3)"/>
<span class="err"></span>
</div>
<div class="form_input" id="form-input-4" iid="4">
<label>Фамилия</label>
<input id="form_input_input-4" type="text" name="" iid="" oninput="formoninput(4)"/>
<span class="err"></span>
</div>
</form>
<script type="text/javascript">
function formoninput(iid){
var clas = $('#form-input-'+ iid).attr("class");
var input = document.getElementById('form_input_input-'+ iid);
$('.form_input').removeClass('form_input activ').addClass('form_input');
if (input.value.length > 0){
$('#form-input-'+ iid).removeClass('form_input activ').addClass('form_zapis');
}else{
$('#form-input-'+ iid).removeClass('form_zapis').addClass('form_input activ');
}
};
$(document).ready(function() {
$('.form_input').click(function() {
var iid = $(this).attr("iid");
var clas = $(this).attr("class");
$('.form_input').removeClass('form_input activ').addClass('form_input');
if (clas!='form_zapis'){$('#form-input-'+ iid).removeClass('form_input').addClass('form_input activ');}
setTimeout(function (){
$('body').click(function(){
$('.form_input').removeClass('form_input activ').addClass('form_input');
});
});
return false;
});
});
</script>
<style type="text/css">
<!--
#shablon_registration_1{
}
#shablon_registration_1 .form_zapis{
border: 1px solid #adadad;
position: relative;
border-radius: 8px;
padding: 0;
transition: all 100ms ease-in-out;
margin: 1.5em 0.5em 0.5em 0.5em;
box-shadow:0 0 3px 0 #00bff3;
border-color:#2edfff;
}
#shablon_registration_1 .form_zapis label {
position: absolute;
left: 0;
background-color: #fff;
margin-left: 15px;
font-weight: 400;
padding: 0 3px;
transition: all 100ms ease-in-out;
cursor: text;
display: inline-block;
max-width: 100%;
margin-bottom: 5px;
font-size: 14px;
z-index: 15;
top: -14px;
color: #00bff3;
}
#shablon_registration_1 .form_zapis label:after {
content: "*";
color: #00bff3;
line-height: 18px;
vertical-align: super;
}
#shablon_registration_1 div.form_input{
border: 1px solid #adadad;
position: relative;
border-radius: 8px;
padding: 0;
transition: all 100ms ease-in-out;
margin: 1.5em 0.5em 0.5em 0.5em;
}
#shablon_registration_1 div.form_input.activ{
box-shadow:0 0 3px 0 #00bff3;
border-color:#2edfff;
}
#shablon_registration_1 div.form_input label{
position: absolute;
top: 3px;
left: 0;
color: #adadad;
background-color: #fff;
margin-left: 15px;
font-weight: 400;
padding: 0 3px;
transition: all 100ms ease-in-out;
cursor: text;
display: inline-block;
max-width: 100%;
margin-bottom: 5px;
}
#shablon_registration_1 div.form_input label:after {
content: "*";
color: #ca2029;
line-height: 18px;
vertical-align: super;
}
#shablon_registration_1 div.form_input.activ label:after {
color: #00bff3;
}
#shablon_registration_1 div.form_input.activ label{
font-size: 14px;
z-index: 15;
top: -14px;
color: #00bff3;
}
#shablon_registration_1 div.form_input input, #shablon_registration_1 div.form_zapis input{
border: 0;
outline: 0;
margin: 0;
display: block;
z-index: 10;
color: #000;
font-size: 14px;
border-radius: 8px;
width: 100%;
height: 34px;
padding: 6px 12px;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}
#shablon_registration_1 div.form_input input:focus {
box-shadow: 0 0 8px rgba(102,175,233,.6),inset 0 0 0 50px #fff;
.form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
}
#shablon_registration_1 div.form_input span.err{
max-width: 90%;
color: #ca2029;
font-size: 14px;
line-height: 15px;
padding-left: 10px;
margin-top: -5px;
display: none;
min-height: 15px;
text-align: left;
}
-->
</style>