Yii ClientSide Validation on Render Partial not Working

前端 未结 3 1121
借酒劲吻你
借酒劲吻你 2021-02-10 07:22

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:28

    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.

提交回复
热议问题