Answer the question
In order to leave comments, you need to log in
After updating the code section containing the form fields via ajax, does the axaj-validation of the fields disappear?
After updating the code section containing the form fields via ajax, the axaj-validation of the fields disappears. Please, prompt in what there can be a business and where to dig?
It is very important that the validation
rules are checked right after filling in the form
fields ;
}
return $this->render('index',['params'=>$params]);
In view I use ActiveForm
Answer the question
In order to leave comments, you need to log in
Where to dig? Why should she work at all? The page loaded, validation was hung on the fields. The fields have changed. Why should it work if the fields are different now? Those on which it was hung no longer exist.
After replacing the fields, rehang the validation.
I use the YiiActiveForm form widget, so the view requires connection or generation (from yii) of javascript code, but js, as I understand it, will neither be connected nor displayed. And in my case with YiiActiveForm, this led to the fact that client-side javascript and ajax validation stopped working. The fields on which the ajax validation was hung remained the same.
if(Yii::$app->request->isAjax){
return $this->renderPartial('agent_ajax',['params'=>$params]);
}
return $this->render('index',['params'=>$params]);
Tried replacing renderPartial with renderAjax, didn't help
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question