Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
https://github.com/samdark/yii2-cookbook/blob/mast...
www.mushtaqtahir.com/blog/3/yii2-ajax-form-submission
stackoverflow.com/questions/28127932/how-to-send -a...
$('body').on('beforeSubmit', ‘form#formId', function () {
var form = $(this);
// return false if form still have some validation errors
if (form.find('.has-error').length) {
return false;
}
// submit form
$.ajax({
url: form.attr('action'),
type: 'post',
data: form.serialize(),
success: function (response) {
// do something with response
}
});
return false;
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question