A
A
Anton2016-07-05 02:45:13
Yii
Anton, 2016-07-05 02:45:13

How to submit an ajax form?

Is there any built-in way to submit a form in yii2 using Ajax, or do I need to write it myself?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Дмитрий Ким, 2016-07-05
@kimono

Используйте Pjax:

Pjax::begin();
$form = ActiveForm (['options' => ['data-pjax' => true]]);
//...
ActiveForm::end();
Pjax::end();

Максим Тимофеев, 2016-07-05
@webinar Куратор тега Yii

1 вариант: pjax
2 вариант: ajax валидация. Если включить ajax валидацию и настроить только на beforesubmit, то получите post запрос ajax-om

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question