I have a login form, when you Click the login button the form fadesIn(), then when the user submits the page it is reloaded with the Error validation.
The issue is, Once the page loads again, the form box doesn't appear because there was no trigger from the login button. Is there a way that once the form has been submitted, the javascript automatically fadesIn the form box again?
example
//Login trigger
<a href="#" class="login">Login</a>
//Form that appears on trigger
<form method="POST" action="index.php">
<label>Username</label><input type="text" name="username" />
<label>Password</label><input type="password" name="password" />
<input type="submit" name="submit" value="submit" />
</form>
JQuery
$("a.login").click(function(event) {
event.preventDefault();
$("form").fadeIn("200");
});
User submits form -> page reloads -> want the page to automatically trigger the login handler so the form fades back in