Ajax forms are sended without beign validated
JanMikes opened this issue · comments
Nette 2.3 - works with original netteForms.js (alert window appears), with live-form-validation form is sent instantly.
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.
Could you prepare me live example of the problem via http://jsbin.com/ ?
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.
Ok i will try.
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!
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.