On Post请求<?php echo $form->errorSummary($model) ?>
在提交表单后自动出现在页面上并显示表单错误的摘要。如何让它出现在Ajax请求中?
编辑:
以下是我的视图文件:
<div class="form" >
<?php
$form = $this->beginWidget('CActiveForm',array(
'id'=>'change-profile-form',
'enableAjaxValidation'=>true,
'enableClientValidation'=>true,
'action' => Yii::app()->createUrl('upanel/user/CProfile'),
'method' => 'POST',
'clientOptions'=>array(
'validateOnSubmit'=>true,
'validateOnChange'=>true,
'validateOnType'=>false,
),
));
?>
.
.
.
<div class="row">
<?php
echo CHtml::ajaxSubmitButton(
'update',
Yii::app()->createUrl('upanel/user/CProfile'),
array(
'type'=>'POST',
'data'=>"js:$('#change-profile-form').serialize()",
'success'=>'callback',
'beforeSend'=>'before',
),
array(
'id'=>'update-button'.uniqid(),
'class'=>'submit-button',
)
);
?>
</div>
<?php $this->endWidget() ?>
</div> <!-- End The Profile Form -->
<?php echo $form->errorSummary($model,'Please solve these errors:') ?>