开发者

ErrorSummary for multiform model

开发者 https://www.devze.com 2023-02-08 14:17 出处:网络
I am using a multi form model. A $model array is passed to the view and for each mod开发者_如何学Pythonel object I am trying to have an errorsummary. See the code below.

I am using a multi form model. A $model array is passed to the view and for each mod开发者_如何学Pythonel object I am trying to have an errorsummary. See the code below.

foreach ($model as $f=>$edu): echo $form->errorSummary($edu,''); echo $form->textField($edu,"[$f]schoolname",array('size'=>30,'maxlength'=>128)); endforeach;

When I submit the form an error summary for only one form is displayed. Any ideas.


Maybe you need to rethink your form structure, for example - put all into one form, then inside controller make validation of every model you use and then show error messages.

0

精彩评论

暂无评论...
验证码 换一张
取 消