bootstrap-validator icon indicating copy to clipboard operation
bootstrap-validator copied to clipboard

Form submitted with errors

Open lcsqlpete opened this issue 7 years ago • 4 comments

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

lcsqlpete avatar Aug 10 '17 22:08 lcsqlpete

Same issue. Any idea?

yamila-fraiman avatar Aug 22 '17 23:08 yamila-fraiman

well the docs very clearly say that if e.isDefaultPrevented() returns false, then validation failed. You must check that in your own hanlder.

ztane avatar Sep 06 '17 17:09 ztane

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 .

lcsqlpete avatar Sep 06 '17 17:09 lcsqlpete

sorry yeah, the event is 'submit'

ztane avatar Sep 07 '17 05:09 ztane