contributte / live-form-validation

:no_entry: Nice client-side live form validation for Nette Forms.
https://contributte.org/packages/contributte/live-form-validation.html
BSD 3-Clause "New" or "Revised" License
59 stars 24 forks source link

Ajax forms are sended without beign validated #24

Closed JanMikes closed 8 years ago

JanMikes commented 8 years ago

Nette 2.3 - works with original netteForms.js (alert window appears), with live-form-validation form is sent instantly.

JanMikes commented 8 years ago

As workaround, this extension is working for me:

$.nette.ext('ajaxForms', {
    before: function (jqXHR, settings) {
        if (settings.nette && settings.nette.form) {
            return Nette.validateForm($(settings.nette.form)[0]);
        }
    }
});

Although i think it should be working by default, as with netteForms.js everything works fine.

Robyer commented 8 years ago

Could you prepare me live example of the problem via http://jsbin.com/ ?

Robyer commented 8 years ago

Btw current version of LiveFormValidation is based on netteForms.js from Nette/Forms v2.4 Better check if it's not problem of the incompatible 2.3/2.4 versions.

JanMikes commented 8 years ago

Ok i will try.

JanMikes commented 8 years ago

Oh my god, i found out what is wrong when playing around. When using master of vojtech-dobes/nette.ajax.js live-form-validation does not work with ajax, but with stable 2.1.0/2.0.0 everything is ok!

Robyer commented 8 years ago

So question is now whether it should be fixed in nette.ajax.js or in live-form-validation.js. Let me know or send PR if/when you find out what's wrong exactly.