OKay, I'm trying to setup my site to be all on one page with a login/
logout button.
When the user clicks "Login", a hidden div with my form in it is
displayed. Once they login successfully, "Login" becomes "Logout".
When they click "Logout", it goes back to showing "Login", and then
they can click it to show the form again.
The problem is when they click "Login" the second time, and submit the
form, I get an error:

$.data(element.form, 'validator') is undefined

This is what my code looks like now (simplified):

function loginDone(data) {
        $('#login-link').fadeOut('fast', function() {
                $('#logout-link').fadeIn('fast');
        });
}

$(document).ready(function() {
        loginFormVal = $('#loginForm').validate({
                submitHandler: function(form) {
                        $(form).ajaxSubmit({
                                dataType: 'json',
                                success: loginDone
                        });
                }
        });
});

Reply via email to