Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

submitSuccess fires off multiple times if put inside a button #82

Open
jmargathe opened this issue May 13, 2013 · 0 comments
Open

submitSuccess fires off multiple times if put inside a button #82

jmargathe opened this issue May 13, 2013 · 0 comments

Comments

@jmargathe
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant