Chtml::errorsummary($Model); Not Working!


So I am trying to submit a simple form

Form Model :

public function rules()


	return array(

		array('email', 'required'),




View File

<?php $form=$this->beginWidget(‘CActiveForm’, array(


				        'enableClientValidation'=&gt;true, // enabled




				)); ?&gt;

				&lt;?php echo CHtml::errorSummary(&#036;model); ?&gt;

<?php echo CHtml::activeLabelEx($model,‘email’)?>

                        &lt;?php echo CHtml::activeTextfield(&#036;model,'email')?&gt;

<?php echo CHtml::submitButton(‘Submit’); ?>




		    	&lt;?php &#036;this-&gt;endWidget(); ?&gt;

[b]Controller Action


$model=new ForgotEmailForm;


		//echo &quot;You are in Forgot PAssword&quot;;


		if(isset(&#036;_POST['ForgotEmailForm'])) { 




The problem is , when I push submit button. It doesnot show anything in the CHtml::errorSummary($model);

In your controller, you have


happening before anything gets a chance to be checked. The render method is basically halting your application right at that point no matter what.

Edit: Try something like this. It will do post processing and then render afterwards

$model = new ForgotEmailForm;

if($data = Yii::app()->request->getPost('ForgotEmailForm')) {

    $model->attributes = $data;

    if($model->validate()) {




$this->render('forgotpassword', array('model' => $model));

Thanks this helped!! Cheers :)