I'm using the ajax form plugin for jquery (1.2.6).  I'm running into a
problem with multiple submits, where on the second submission the
response is not assigned to the correct state, even though the
submission was successful.  Instead, the response is classified under
the onreadystatechange.  It should also be noted that the form is
contained in a jqModal popup/lighthouse.

I can reproduce this 2 ways:

1) Submit the form successfully twice without reloading the page.  The
second submission will sccessfully go through, but the response is not
interpretted correctly (as stated above, instead of being received
under the successflag it is caught in the onreadystatechange flag).

2) If I submit the form with an error and my validation catches the
error (causing the submit to fail), then correct the error and
resubmit... same thing happens.

My setup is pretty basic:

$('#myForm').ajaxForm({
        beforeSubmit:
                function()
                {
                        /* my validation*/
                },
        success:
                function(msg)
                {
                        eval(msg);
                        if (response.status == 'ok')
                        {
                                var m = '<p 
class="message">'+response.message+'</p>';
                        }
                        else
                        {
                                var m = '<p 
class="error_message">'+response.message+'</p>';
                        }
                        $('#emailContentForm').clearForm();
                        $('#emailContentError').html('');
                        $('#system-message').html(m);
                        $('#email-popup').jqmHide();
                }
        });
        return false;
});

Reply via email to