How to process ajax response in ActiveForm Yii2?

How to process ajax response in ActiveForm Yii2?

Form makes a request using ajax:
<?php $form = ActiveForm::begin([
 'enableAjaxValidation' =--> true
]) ?>
...


The server sends a response in JSON.
How to handle it? As to the form to hang a javascript callback after passing the validation (including the server) and successfully send data to the server?

I tried to do a response as JSONP, but it also gave nothing
July 4th 19 at 23:34
1 answer
July 4th 19 at 23:36
Solution
Good morning.
If You mean ajax validation, then look here
No. I have a form adds Ajax comments. Yes, the validation rules work. And then the server returns number of new comments and so on - it is necessary to dynamically insert into the page. I can not figure out how to form ActiveForm hang of this (after Ajax submission). - Fletcher_Hartma commented on July 4th 19 at 23:39
: You can use Pjax
ksetrin.com/blog/post/use-pjax-widget-in-yii2-with... - Dion77 commented on July 4th 19 at 23:42

Find more questions by tags AJAXJavaScriptPHPYii