Can't find the bug in this jQuery code
<p>I have the following code, which, upon the press of a certain button, should validate for an email address (this functionality works already), and then should try to post my form, and if it gets back "Error", it should show an error. I think I'm mixing up PHP and JS somewhere.</p>

<pre><code>$('#recoverSub').live('click',function() {
        $("#recoverPost").validate({
            rules: {
                recoverField: {
                    email: true
                }
            },
            messages:{
                recoverField: {
                    email: "Not a valid email."
                }
            }
        });
        if($("#recoverPost").valid())
        {
            $.post('php/recoverPost.php', $('#recoverPost').serialize(), function(){
                function(data) {
                    if(data != "Error")
                    {
                        $('#recoverPost').hide();
                        $('#success').show();
                    }
                    else
                    {
                        echo "This email is not in our records.";
                    }
                }
            });
        }
    });
</code></pre>
