Jquery validation will not execute
<p>For some reason my jquery validation and ajax will not work and i cannot see where i did this script wrong. I am referencing jquery in my header, and when i remove the ajax function the script runs fine. Anyone see whats going on?</p>

<pre><code>&lt;script type="text/JavaScript"&gt;

$(document).ready(function() {

$('#btn-submit').click(function(e) { 

    // stop normal button action, whatever it is
    e.preventDefault();

    $(".error").hide();
    var hasError = false;
    var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

    var emailaddressVal = $("#UserEmail").val();
    if(emailaddressVal == '') {
        $("#submit").after('&lt;span class="error"&gt;Please enter a email address.&lt;/span&gt;');
        hasError = true;
    }

    else if(!emailReg.test(emailaddressVal)) {
        $("#submit").after('&lt;span class="error"&gt;Email Not Valid');
        hasError = true;
    } else if(emailReg.test(emailaddressVal)){
        $("#submit").after('&lt;span class="error"&gt;Email Updated');
    }

   if (!hasError) { 
    $.ajax({
       type: "POST",
       url: "updateEmails.php",
       data: "UserEmail="+emailaddressVal,
       success: function(data){
            $(".parentEmail").html(emailaddressVal);
       }
     });
    }

});
});
&lt;/script&gt;

&lt;form method="post" name="form1" action=""&gt;
&lt;label&gt;Email Address:&lt;/label&gt;
&lt;input type="text" name="UserEmail" id="UserEmail" value="" size="32" /&gt;
&lt;input type="submit" value="Submit" id="btn-submit" /&gt;
&lt;/form&gt;
</code></pre>
