Внутрь каждого блока мы поместим поля и простые label
:
Мы использовали три поля ввода: Логин, Пароль
и Подтвержение пароля
, а в конце блока тег input
с типом submit
для перехода на следующий шаг. Другие блоки работают точно также.
В конце контейнера у нас простой индикатор выполнения, вот его код:
Полный html
код такой:
Как вы могли заметить, на четвертом шаге таблица пустая. Мы заполним её информацией, вводимой пользователем с помощью jQuery.
CSS
Теперь добавим стили к форме. Будем применять правило @fontface
для использования пользовательских шрифтов. В нашем случае это шрифт Cantarell
. Полный код CSS
приведен ниже:
/* CSS Reset (Eric Meyer) */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
@font-face {
font-family: "Cantarell";
src: url(../fonts/Cantarell-Regular.eot);
src: local("Cantarell"), url("../fonts/Cantarell-Regular.ttf") format("truetype");
}
body {
background-color: #f9f9f9;
color: #222;
font-family: Cantarell, Verdana, sans-serif;
font-size: 12px;
}
input::-moz-focus-inner, input::-moz-focus-inner { border: none; }
input:focus, input:focus { outline: none; }
.clear { clear: both; }
#container {
background: url("../images/container.png") no-repeat;
width: 754px;
height: 370px;
margin: 20px auto;
padding: 50px 0;
overflow: hidden;
position: relative;
}
#container #first_step, #second_step, #third_step, #fourth_step { display: none; }
#container #first_step { display: block; }
#container .form { margin: 66px 72px 0 72px; }
#container h1, #container h2 {
font-size: Cantarell, Verdana, sans-serif;
text-align: center;
font-size: 24px;
text-shadow: 1px 1px 2px #222;
}
#container h1 span { color: #a90329; }
#container h2 {
color: #888;
font-size: 20px;
text-align: left;
text-shadow: none;
}
#container table {
margin: 20px 40px;
font-size: 14px;
font-weight: bold;
}
#container table td {
padding: 5px 10px;
}
#container table td:nth-child(2) {
color: #a90329;
}
#container input, #container select {
background: url("../images/input.png") no-repeat;
color: #888;
border: 1px solid #ccc;
font-family: Cantarell, Verdana, sans-serif;
font-weight: bold;
font-size: 15px;
width: 300px;
height: 35px;
padding: 0 25px;
margin: 20px 0;
float: left;
border-radius: 6px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
}
#container input.submit {
background: url("../images/button.png") no-repeat;
border: none;
cursor: pointer;
width: 85px;
height: 38px;
position: relative;
bottom: 2px;
left: 655px;
}
#container input.submit:focus { border: none; }
#container input.send{ background: url("../images/send.png") no-repeat; }
#container input.error { border: 1px solid red; }
#container input.valid { border: 1px solid #1FFF00; }
#container input:focus, #container select:focus {
border: 1px solid #a90329;
color: #a90329;
}
#container select { padding: 5px 0 5px 25px; }
#container option { padding: 0 15px; }
#container label {
color: #666;
font-size: 12px;
font-weight: bold;
line-height: 14px;
float: right;
margin: 23px -25px;
width: 270px;
}
#progress_bar {
background: url("../images/progress_bar.png") no-repeat;
width: 339px;
height: 24px;
margin: 0 auto;
position: relative;
}
#progress {
background: url("../images/progress.png") repeat-x;
width: 0px;
height: 23px;
border-radius: 20px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
}
#progress_text {
position: relative;
line-height: 21px;
text-align: center;
font-weight: bold;
color: white;
text-shadow: 1px 1px 2px #222;
width: 339px;
height: 24px;
top: -23px;
left: 0;
}
JS
jQuery
будем использовать для плавной смены блоков (слайды), проверки правильности данных, изменения процента выполнения.
Нам нужно будет в шапке старницы подключить библиотеку jQuery
и ещё два плагина:
jQuery UI
и jQuery inputfocus
(используется для управления фокусом и размытия событий формы).
jQuery
код приведен ниже:
$(function(){
//original field values
var field_values = {
//id: value
"username" : "Логин",
"password" : "Пароль",
"cpassword" : "Пароль",
"firstname" : "Имя",
"lastname" : "Фамилия",
"email" : "email"
};
//inputfocus
$("input#username").inputfocus({ value: field_values["username"] });
$("input#password").inputfocus({ value: field_values["password"] });
$("input#cpassword").inputfocus({ value: field_values["cpassword"] });
$("input#lastname").inputfocus({ value: field_values["lastname"] });
$("input#firstname").inputfocus({ value: field_values["firstname"] });
$("input#email").inputfocus({ value: field_values["email"] });
//reset progress bar
$("#progress").css("width","0");
$("#progress_text").html("0% Выполнено");
//first_step
$("form").submit(function(){ return false; });
$("#submit_first").click(function(){
//remove classes
$("#first_step input").removeClass("error").removeClass("valid");
//ckeck if inputs aren"t empty
var fields = $("#first_step input, #first_step input");
var error = 0;
fields.each(function(){
var value = $(this).val();
if(value.length<4 || value==field_values[$(this).attr("id")]) {
$(this).addClass("error");
$(this).effect("shake", { times:3 }, 50);
error++;
} else {
$(this).addClass("valid");
}
});
if(!error) {
if($("#password").val() != $("#cpassword").val()) {
$("#first_step input").each(function(){
$(this).removeClass("valid").addClass("error");
$(this).effect("shake", { times:3 }, 50);
});
return false;
} else {
//update progress bar
$("#progress_text").html("33% Выполнено");
$("#progress").css("width","113px");
//slide steps
$("#first_step").slideUp();
$("#second_step").slideDown();
}
} else return false;
});
$("#submit_second").click(function(){
//remove classes
$("#second_step input").removeClass("error").removeClass("valid");
var emailPattern = /^+@+\.{2,4}$/;
var fields = $("#second_step input");
var error = 0;
fields.each(function(){
var value = $(this).val();
if(value.length<1 || value==field_values[$(this).attr("id")] || ($(this).attr("id")=="email" && !emailPattern.test(value))) {
$(this).addClass("error");
$(this).effect("shake", { times:3 }, 50);
error++;
} else {
$(this).addClass("valid");
}
});
if(!error) {
//update progress bar
$("#progress_text").html("66% Выполнено");
$("#progress").css("width","226px");
//slide steps
$("#second_step").slideUp();
$("#third_step").slideDown();
} else return false;
});
$("#submit_third").click(function(){
//update progress bar
$("#progress_text").html("100% Выполнено");
$("#progress").css("width","339px");
//prepare the fourth step
var fields = new Array($("#username").val(),
$("#password").val(),
$("#email").val(),
$("#firstname").val() + " " + $("#lastname").val(),
$("#age").val(),
$("#gender").val(),
$("#country").val());
var tr = $("#fourth_step tr");
tr.each(function(){
//alert(fields[$(this).index()])
$(this).children("td:nth-child(2)").html(fields[$(this).index()]);
});
//slide steps
$("#third_step").slideUp();
$("#fourth_step").slideDown();
});
$("#submit_fourth").click(function(){
//send information to server
alert("Данные отправлены");
});
});
Вот у нас и получилась форма с регистрацией в несколько шагов. Для использования данного примера нужно только изменить форму action
с ссылкой на ваш php
файл, используемый для хранения данных и отредактировать 132 строчку на:
$(‘form’).unbind(‘submit’).submit();
. Чтобы посмотреть форму в действии нажмите на кнопку Демо
.
Login forms can be found in websites with forums, shops, WordPress and mostly everything on the internet requires login form somewhere to get access to something. The whole web is incomplete without login forms and registration, signups forms.
HTML forms will be first which most of us come across and with proper CSS which gives style to the HTML structure . In latest HTML versions i guess HTML seems to have opted for CSS3 as their default structure styling option. Anyways what you find here is the pre designed HTML, CSS forms built by front end developers and shared to the public for free to use.
Try to use all these free login form templates as most of them also have pre built HTML validation features as well as some opt jQuery or HTML validation (like the Login/Register form with pass meter below).
This list is not over yet, i am interested in finding new login form designs so i will keep updating these list with new login form templates when they show up in 2017. Stay tuned.
Red Login Form
A simple and effective login form for your website which requires basic input fields and no extra programming.
A flat login form design designed for your website which is already flat. Download and use this template for any purpose.
Require a quick signin for your clients ? No worries, this pretty looking login form will get you going without any hassles. Download the source code and check the demo as you can put a sample username and password in the fields and try to login. You will be taken to a profile page on the same which looks glorious with a logout button which shows the logging out animation.
With google material design getting popular over flat design we can see a deep and carefully shadowed login form and a register form in this css3 template.
Here you get another brilliant login form for your busienss website with a option to hide/show login fields. Well coded css/html/js design will give you better loading without tampering your current site speed.
Minimal Login Form with fluid animation
A smooth animation of login form which opens up the login section by clicking a picture or a button as you need.
Minimalistic Login Form with css
Here you will find a no-fancy login form ui which is placed on a full screen background. The download file will get you css and html for easy implementation of this login to your website.
Animated Login Form
The click animations displayed on text fields is brilliant which displays a small sliding animation of user and password icons. You can then login the form to watch a authenticating pre loader as well as a welcome back block. This download contains all the source files to implement a login form for your own website.
Elegant Login
This is a simple version of login form you can display on your website as this also has less impact on site speed with its minimal code.
Calm Login Screen
A clean login form with animated background giving a relaxing feel to the whole page. Download the whole template in zip format from codepen.
Login and Signup Form
Integrate this fluid login and signup form on to your website with ease. The zip file with this download will provide you with css, html and js templates. Social media signup is also available with password show/hide options for on screen easy password entry.
Login Form with Create Account
A login form which displays with a fadein effect is just amusing to watch. This effect can be seen only in few modern login forms. Use the click me to change the form to signup or create form.
A minimal style login form with flat design can be download from the link below. HTML validation is available and set in this login template.
Download
Minimal Form Template for Login
A validation for email is in palce and this tempalte is pure css, html with no fancy jquery modules.
Download
Signup/Login Form
A single form to login to the website as well as a signup, register option which can be flipped with a click. Even though the signup area is missing some important fields this is nonetheless better form with all powerful features.
Download
This login form is hidden unles you click on login link. This is a very useful feature for modern day website which can avoid an extra page for login. Display login on any page you like with this powerful login form.
Download
It’s provided both as a PSD and as a fully-coded HTML/CSS version, so you can get started integrating it straight away.
Login Form (Coded)
A professional login form. The download includes the PSD file, and I also felt like coding it so I included the xHTML, Js and CSS files as well.
Download
White Simple Login Form
A clean and simple login form with a round submit button and elegant focus states.
Simply Login Form
Simply Login Form styled and designed purely using CSS3. The form is created using pretty simple markup and styled using very basic CSS3 properties.
Download
Online Signup and registration forms, are important aspects of almost every web design. If your website needs active contribution from the visitors, then you should have provisions so that they can register or signup to open an account with your site. Users register with a site to download files or post articles, to purchase something & son depending on the theme of a site. The registration forms, are pretty elaborate, asking for a wide range of personal and contact details from the users- like age, name, gender, job, brief biography and so on. But the most important aspect of all HTML5 Signup & Registration Forms are name, username, password, gender and account creation button.
XtraForm – Bootstrap 3 Xtra Animated Form HTML5 Format
This bootstrap registration form template is coded based on jQuery mobile JavaScript which makes it compatible across many platforms and also make it very customizable. The html5 form template is available for free download here.
Multi-Step Signup Form With CSS3 and jQuery
This kind of registration form in html with CSS3 helps in sectioning of various parts of a long sign up form, thus making it easy to maintain records whereas jQuery ensures that these forms can work on a wide number of platforms. Download the sign up page template from here to build a form for your own site today.
Authentix – Ready to Integrate User System HTML Format
This kind of html5 form template is created by simple PHP script for signing up, logging in or authenticating users. This kind of login and registration form templates can also provide the feature of secure sessions. Download one from here to implement one of these in your own site.
This kind of registration form template uses CSS for registration form and is very helpful in creating sign up forms meant for the android platform. This kind of html registration form template is available for download below.
Codepen Sign Up Form in HTML Format Download
With its revamped fresh design and very simple interface, this kind of html5 form templates have been carefully optimized for creating new user registration forms. With its utility in various fields, these signup form templates are really handy and can be downloaded right from the link below.
Formplexy – CSS Forms with Validation & WP Support HTML Format
This kind of html registration form is very neat and customizable for any developer. It is extremely fast due to CSS form with jQuery. It also has WordPress support, social buttons and an option of forgotten password handling. Download the form from here to use it in your own site.
Download Login & Registration Form with HTML5
This kind of registration form template is used for login and signup due to the fact that it is very simple and uses very simple coding. This kind of html5 form templates find a wide number of uses due to their light structure and can be downloaded right from here.
Tab Login & Sign Up Forms HTML Download
This kind of signup form templates are widely used due to their tab oriented look which is very helpful in categorizing thing. This type of html5 form templates can be downloaded here to be used for long sign up forms with many fields for taking information.
Signup Form Flat Template Download
With its minimalistic look , this kind of registration form template is widely used due to their simple and clean look and due to the fact that this kind of html5 signup template can work on many platforms. You can get one of these forms here for download.
Flat Look HTML5 & CSS3 Signup Form Template Free Download
Equipped with the simplicity and cleanliness of an html5 coding coupled up with the security of a CSS3 signup security with jQuery, this kind of signup form template is one of the best options you can find for your site. Want to know how will it look for your site? Just quickly download it from the link below to check it out.
How to Create Registration Page?
A registration page on a website consists of registration form that lets website users to get registered with the website and get access to applicable facilities, services or products. A registration page is considered to be the most important aspect of a website as it gives you a way to be more interactive with your users. For creating a registration page, first you just need to add a new page through your CMS and then add the and registration form to it. You can find a large number of registration form templates online for easy and quick installation on to your page.
Awesome Design HTML5 and CSS3 Login & Sign Up Forms
This HTML5 and CSS3 login and signup form comes with an awesome design with perfectly sectioned fields. The form is handy and easy to install. Just download the form and you can customize it as per your preferences.
Simple, Highly Functional and Effective HTML5 Register Form
Need a sign-up form created for a newsletter registration? This super cool sign form template comes with an amazing blurred background style that can complement any of your website design type. Get downloaded and add to your registration page.
HTML5 & CSS3 Register Login Responsive Template Example
Here is another wonderful HTML5 and CSS3 registration and login form ideal to meet registration form requirement of your website belonging to any niche. Comes with an eye-catchy design and superior functionality to offer a secure registration environment.
How to Make Signup / Registration Forms?
Whether you are a professional web designer or a website owner who is looking to create a registration form for website, it takes almost equal efforts for all to get an elegant and professional sign up form added to the website. You can explore a large selection of responsive and eye-catchy online that you can hardly create yourself. The best part with these templates is that along with their standard use, you can customize the fields, size as well as color of the form elements quite easily in minutes. Whether you need a student registration form, ecommerce registration form, event registration form or more, you can find template forms for all kinds of your sign-up form needs. There are numerous such registration and login templates that offer you a secure, effortless and elegant forms to be added to your websites. You just need to get these downloaded in a few clicks and do minor customizations is necessary.