The Web is growing rapidly. Each day, new features are arriving. With the coming of AJAX, many websites became more easy to handle. With jQuery, websites became more attractive with animations and styles. In this tutorial, we are going to create a stylish animated Login Form with jQuery, CSS & AJAX. With this, the login time for the user is greatly reduced as the page shouldn’t be loader all over again.
The Login Page
We make a login page first loading with jQuery and the stylesheet :
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<script src="form.js"></script>
<link href="form.css" rel="stylesheet" />
</head>
<body>
<div id="content">
<div class="loginForm">
<label>
<span>Username</span>
<input type="text" name="username" />
</label>
<label>
<span>Password</span>
<input type="password" name="password" />
</label>
<div class="submit">Log In</div>
<div class="overlay">
<div class="message processing">
<h2>Logging In</h2>
</div>
<div class="message error">
<h2>Incorrect Credentials</h2>
<p>The username or password you entered was not correct</p>
</div>
<div class="message success">
<h2>Logged In</h2>
<p>You have been logged in</p>
</div>
</div>
</div>
</div>
</body>
</html>
We have a login form with two fields : username and password with a login button. We also have an overlay showing messages on each actions. Note that the login form is not wrapped in the native