Answer the question
In order to leave comments, you need to log in
Pjax with ActiveForm, inside ActiveForm perhaps?
Hello! Tell me , please,
There is a form (ActiveForm) of model1 on the page.
Inside this form is a pjax block with another ActiveForm form for adding information to model2.
When the model2 form submits, pjax is not processed and the model1 form submit occurs.
Tell me how to implement correctly? Or is it wrong to do so?
$form1 = ActiveForm::begin();
Pjax::begin(['id' => 'notes']);
$form2 = ActiveForm::begin(['action' => '/note/save', 'options' => ['data-pjax' => '1']]);
$form2->field($notes, 'text')->textarea(['rows' => 3]);
Html::submitButton('Add', ['data-pjax' => '1'])
ActiveForm::end();
Pjax::end()
ActiveForm::end();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question