I am using validationEngine to validate a form before it is sent;
plug-in
http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/
It works fine except when I write my on submit handle to a form.
For instance
<form id="form" action="controller/action" method="post"></form>
$('#form').submit(function() {
$.ajax({
url: form.attr('action'),
type: form.attr('method'),
success: function (response) {
success(response);
}
});
});
the validation is performed but the form is posted anyway.
I have also tried to get the returned value with:
alert($("#formUpdStoringSettings").validationEngine('validate'));
and it always return true for forms and false for fields wich means that the validation is ok.
Is there any workaround for that as long as I need to have my custom submit event?
Turns out validationEngne aims to validate form during the interaction the user with the form. It is not intended to validate on submit event.
I had to create my own validation functions.