bootstrap-validator
bootstrap-validator copied to clipboard
Form submitted with errors
The validator works in terms of detecting errors as data is entered into a form, but the form is still submitted when I click the Submit button even if there are errors on it. I've tried checking e.isDefaultPrevented() as mentioned in the docs but that comes back false so doesn't solve the problem.
I have my own js script to handle a click on the submit button like this "$(":submit").on("click", function (e) { which makes an Ajax call to submit the form. Could that be getting in the way?
Pete
Same issue. Any idea?
well the docs very clearly say that if e.isDefaultPrevented()
returns false, then validation failed. You must check that in your own hanlder.
And I do.
On Wed, Sep 6, 2017 at 10:43 AM, Antti Haapala [email protected] wrote:
well the docs very clearly say that if e.isDefaultPrevented() returns false, then validation failed. You must check that in your own hanlder.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/1000hz/bootstrap-validator/issues/579#issuecomment-327560081, or mute the thread https://github.com/notifications/unsubscribe-auth/AIGhFNi8ZO1C0zQtctPBYwePvSk087v3ks5sftnBgaJpZM4O0E5i .
sorry yeah, the event is 'submit'