Answer the question
In order to leave comments, you need to log in
ZF2 validation filter fails on ajax request?
When sending data by Ajax, by clicking on submit, the input filter does not work (does it not display a message saying that the password in the input is too short or the required field is empty at all)? I can't figure out why
form.find('.js-event-submit').on('click', function(){
var dataForm = form.serialize();
$.ajax({
type: 'POST',
url: form.attr('action'),
dataType: 'json',
data: dataForm,
success: function(data){
if(data.completeRegistration) {
form.find('.js-event-success').show();
}
console.log(data);
}
});
return false;
});
Answer the question
In order to leave comments, you need to log in
When sending data by Ajax, by clicking on submit, the input filter does not work (does not display a message saying that the password in the input is too short or the required field is empty in general)
console.log(data);
? What does an AJAX request handler return? Hopefully JSON/XML and not HTML?Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question