Every time you're doing:

you're re-attaching an additional submit event to the form, so it's
executing it multiple times every time you submit.
What is it you're trying to do? When you define submitHandler for
validate, you should be doing whatever you're doing in $(form).submit
() inside the submitHandler.

On Feb 8, 7:21 am, zubin <zubin...@yahoo.com> wrote:
> I'm having a problem with validating first then submitting a form with
> jQuery after success. It works however it seems like my submit()
> function keeps sending multiple submits and keeps growing each time i
> reuse the form (i made sure the values are reset after each submit).
> I'm not sure if its my code since i've re-checked it for hours to no
> avail. Here is the code in a nut-shell:
>
> My form with id of #form-external-link is validated when submit button
> is clicked:
>
> $("#form-external-link").validate({
>         rules: {
>                 exlink_url: {
>                         required: true,
>                         url: true
>                 }
>         },
>         submitHandler: function(form) {
>                 alert('This will pop up only once as it should');
>                 $(form).submit(function() {
>                         alert('This will pop up every twice, 3x, 4x, etc. 
> after each
> validate success');
>                 });
>         }
>
> });
>
> Am I missing something from my code??

Reply via email to