$(function() { if ($("input#email").val() == "") { $("input#email").focus(); } }); $(function() { $('.error').hide(); $(".button").click(function() { // validate and process form here $('.error').hide(); var email = $("input#email").val(); if (email == "") { $("span#email_error").show(); $("input#email").focus(); return false; } var dataString = 'form=pwretrieve&email=' + email; //alert (dataString);return false; $.ajax({ type: "POST", url: "inc/scripts/php/pwretrieve_process.php", data: dataString, success: function() { $('#formcontent').fadeOut(400, function() { $('#form').html("
"); $('#message').html("

Form Submitted!

") .append("

An email has been sent containing your login information. If you do not receive an email soon, your email might not be recognized and you will need to use our contact form. Thank You!

") .hide() .fadeIn(1500, function() { }); }); } }); return false; }); });