I have a form where the contents of the form are validated with the
jQuery Validation Plugin.
I am also using a custom submit handler to ajax post the data to a
third party, but I also wish to post the data to the form normally.

Inside of the validation plugin, there is a section that returns false
to the submit call if there is a custom submit function (which makes
sense).

But I wish to, if the return from the third party is success, submit
the form normally.

I am trying a work around, that works on one page, but not on another.

The work around is as follows:

I ajax post to the third party, and if successful, run this function:

function defaultSubmit( ) {
        $('form').unbind('submit');
        $('#submit').click( );
}

I have also tried other permutations for the second line of this
function such as:
$('form').submit( );
$('form')[0].submit( );
document.form.submit( );

all with the same result.

But now when I run this, the browser hangs.  Upon inspection of my
HTTP Headers, I notice that nothing is being sent to the server, the
browser thinks it's sending something, when it really isn't.

So my question is this...   Is the unbind removing the default submit
functionality from the browser?  i.e. when I unbind the submit
functions from the form, is it also removing the default submit
function?

How might I be able to perform this double submit without breaking
anything?

Thanks for any help.

I am using Firefox 2 on Vista, not that it should matter.

Reply via email to