下面我CActiveForm
用来渲染具有相同模型的多个实例的表单。提交表单时,会显示单个属性的 ajax 验证错误,但error summary
不会显示。可能是什么问题?非常感谢
<?php
$form=$this->beginWidget('CActiveForm', array(
'id'=>'task-form',
'enableClientValidation'=>false,
'enableAjaxValidation' =>true,
'clientOptions'=>array(
'validateOnSubmit'=>true,
'validateOnChange'=>false,
),
));
Yii::app()->session['form'] = $form;
?>
<?php echo $form->errorSummary($models); ?>
<ul class="tasks">
<?php foreach($models as $index=>$model): ?>
<?php $this->renderPartial('_task', array(
'model' => $model,
'index' => $index,
'form' => $form,
)); ?>
<?php endforeach; ?>
</ul>
<div class="row buttons">
<?php echo CHtml::submitButton('Save')?>
</div>
<?php $this->endWidget(); ?>
</div>