Yii ClientSide Validation on Render Partial not Working

前端 未结 3 1309
無奈伤痛
無奈伤痛 2021-02-10 07:01

I have a Yii form which calls a render partial from another model (team has_many team_members). I want to call via ajax a partial view to add members in team/_form. All works (c

3条回答
  •  不知归路
    2021-02-10 07:37

    Well, setting processOutput to true in renderPartial (in order to make client validation works on newly added fields) will not help in this case since it will only work for CActiveForm form and you don't have any form in your _member view (only input fields).

    A simple way to deal with this kind of problem could be to use only ajax validation, and use CActiveForm::validateTabular() in your controller to validate your team members.

提交回复
热议问题