Hi, i have a form with 2 different models, and 1 of these models can have multiple rows inside the form.
I managed to do that with this code called by a button firing an ajax action:
ob_start(); $form = ActiveForm::begin(); ob_get_clean();
ob_start(); ActiveForm::end(); ob_get_clean();
return $this->renderAjax('_foo', [
'model' => $model,
'form' => $form,
'index' => $index,
]);
The foo view:
<?= $form->field($model, "[$index]field_name")->textInput()->label(FALSE) ?>
This works fine, i can submit the form and get the input inside the Post.
However, what i miss is javascript validation.
While the first row does it, every row added with Ajax doesn’t.
I tried adding enableAjaxValidation, enableClientValidation ecc. to the form and to the fields, but it doesn’t work either.
How can i do that?
Another question, where can i find the documentation for yii.activeForm.js ?
Thanks in advance