jqBootstrapValidation icon indicating copy to clipboard operation
jqBootstrapValidation copied to clipboard

submitSuccess fires off multiple times if put inside a button

Open jmargathe opened this issue 12 years ago • 0 comments

I'm not exactly sure, but I think the submitSuccess fires off multiple times.

$("button").click(function() {
    $("input", "#form").jqBootstrapValidation({
        submitSuccess: function(booking, e) {
            alert("This is an alert");
            e.preventDefault();
        }
    });
});

In that code sample, the alert will go off according to the number of input text having an error.

For example:

  • There are three required inputs
  • Deliberately miss one and let the validation runs
  • When submitting the form, you'll get two alerts (you should get only 1)

Note: preventDefault is there since I am using AJAX to submit the form, and I have multiple forms in a page.

jmargathe avatar May 13 '13 03:05 jmargathe