S
S
Sergey Pugovkin2016-09-18 03:05:22
JavaScript
Sergey Pugovkin, 2016-09-18 03:05:22

How to handle ajax response in ActiveForm Yii2?

How to handle ajax response in ActiveForm Yii2?

The form makes a request via ajax:

<?php $form = ActiveForm::begin([
    'enableAjaxValidation' => true,
]) ?>
...


The server sends a response in the form of JSON.
How to process it? How to hang a javascript-callback on the form after passing the validation (including the server one) and successfully sending the data to the server?

I tried to make the response in the form of JSONP, but it also did not work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-09-18
@Driver86

Good morning.
If you are talking about ajax validation, then look here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question