How stop an HTML form from submitting if user is not signed in, but allow submit if user is signed in?
<p>In my app, a user must be signed in to submit form info.</p>

<p>After a user clicks on the form submit button, my jQuery checks if a user is signed in. </p>

<p>If not signed in, then an error message pops up, requesting sign in/up.
I can now successfully stop the default action (submit). </p>

<p>However, how do I also allow the default action if the user is already signed in?
With my current code, the default action is also blocked if the user is signed in.</p>

<p>Here's my code:</p>

<pre><code>jQuery('.member-only').click(function(event) {
    var $element = jQuery(this);
    var SignedIn;

    jQuery.ajax({
        type: 'POST',
        url: '/ajax/member',
        dataType: 'json',
        success: function(data) {
            var $err = jQuery('&lt;div&gt;&lt;/div&gt;')
                        .addClass('member-check')
                        .html(data.msg)
                        .css('left', $element.position().left);
            SignedIn = data.SignedIn;

            if (!(data.SignedIn)) { // not signed in
                $element.after($err);
                $err.fadeIn('slow');
                return false;
            }
        }
    });

    jQuery('.member-check').live('click', function() {
        jQuery(this).fadeOut('slow', function() {jQuery(this).remove(); });
    });

    if (!SignedIn) {
        event.preventDefault();
        event.stopImmediatePropagation();
        return false; // block default submit
    }
});
</code></pre>

<p>Thanks.</p>
