Yii Validation Error (Yii_1.1.12)

i am using yii 1.1.12 , one of my registration form not showing error , validation all are working fine , BUT THE ONLY PROBLEM IS THAT <?php echo $form->error($model,'field_name); ?> generating error message WITH A STYLE DISPLAY:NONE (), SO THAT ITS NOT VISIBLE , like following. any help greatly appreciable.

<div class="errorMessage" style="display: none;">Name cannot be blank.</div>

model :

Hi, <?php echo $form->labelEx($model,‘name’); ?> genating a hidden div which will be empty while loading page , after submitting the page , if there is error the innerhtml of the error div changing to error message , but the css style is not changing , so that the error message is not visible to the user. do you have any idea on the same

<?php

/**

  • This is the model class for table "users".

  • The followings are the available columns in table ‘users’:

  • @property integer $id

  • @property string $user_name

  • @property string $password

  • @property string $email

  • @property string $premium_expiry_date

  • @property integer $active

*/

class Users extends CActiveRecord

{

/**


* Returns the static model of the specified AR class.


* @param string &#036;className active record class name.


* @return Users the static model class


*/


    public &#036;name;


    public &#036;date;


    public &#036;month;


    public &#036;year;


    public &#036;gender;


    public &#036;religion;


    public &#036;caste;


    public &#036;mobile;


    


    


public static function model(&#036;className=__CLASS__)


{


	return parent::model(&#036;className);


}





/**


* @return string the associated database table name


*/


public function tableName()


{


	return 'users';


}





/**


* @return array validation rules for model attributes.


*/


public function rules()


{


	// NOTE: you should only define rules for those attributes that


	// will receive user inputs.


                    return array(


		array('user_name, password, email, premium_expiry_date, active', 'required','on'=&gt;array('registration')),


                    array(', password, email, premium_expiry_date, active', 'required','on'=&gt;array('registration')),


		array('active', 'numerical', 'integerOnly'=&gt;true),


		array('user_name, email', 'length', 'max'=&gt;50),


		array('password', 'length', 'max'=&gt;100),


		// The following rule is used by search().


		// Please remove those attributes that should not be searched.


		array('name, date, month, year, gender, religion, caste, mobile, email, password', 'required','on'=&gt;array('reg_home')),


                    array('email', 'unique'),


                    array('date', 'length', 'max'=&gt;2,'on'=&gt;array('reg_home')),


                    array('email', 'email'),


                	array('email', 'length', 'max'=&gt;50,'on'=&gt;array('reg_home')),


                    array('name', 'length', 'max'=&gt;30,'on'=&gt;array('reg_home')),


                    array('month', 'length', 'max'=&gt;20,'on'=&gt;array('reg_home')),


                    array('year', 'length', 'max'=&gt;4,'on'=&gt;array('reg_home')),


                    array('gender', 'length', 'max'=&gt;6,'on'=&gt;array('reg_home')),


                    array('religion', 'length', 'max'=&gt;4,'on'=&gt;array('reg_home')),


                    array('id, user_name, password, email, premium_expiry_date, name, date, month, year, gender, religion, caste, mobile, active', 'safe', 'on'=&gt;'search'),


	);


}





/**


* @return array relational rules.


*/


public function relations()


{


	// NOTE: you may need to adjust the relation name and the related


	// class name for the relations automatically generated below.


	return array(


	);


}





/**


* @return array customized attribute labels (name=&gt;label)


*/


public function attributeLabels()


{


	return array(


		'id' =&gt; 'ID',


		'user_name' =&gt; 'User Name',


		'password' =&gt; 'Login Password',


		'email' =&gt; 'Email',


		'premium_expiry_date' =&gt; 'Premium Expiry Date',


		'active' =&gt; 'Active',


	);


}





/**


* Retrieves a list of models based on the current search/filter conditions.


* @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.


*/


public function search()


{


	// Warning: Please modify the following code to remove attributes that


	// should not be searched.





	&#036;criteria=new CDbCriteria;





	&#036;criteria-&gt;compare('id',&#036;this-&gt;id);


	&#036;criteria-&gt;compare('user_name',&#036;this-&gt;user_name,true);


	&#036;criteria-&gt;compare('password',&#036;this-&gt;password,true);


	&#036;criteria-&gt;compare('email',&#036;this-&gt;email,true);


	&#036;criteria-&gt;compare('premium_expiry_date',&#036;this-&gt;premium_expiry_date,true);


	&#036;criteria-&gt;compare('active',&#036;this-&gt;active);





	return new CActiveDataProvider(&#036;this, array(


		'criteria'=&gt;&#036;criteria,


	));


}

}

controller action:

public function actionIndex()

{


	


        &#036;model=new Users('reg_home');


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


        {


   		


            &#036;model-&gt;attributes=&#036;_POST['Users'];


            &#036;model-&gt;validate();


       		// print_r(&#036;model-&gt;getErrors());


            if(&#036;model-&gt;save())


            {


       		/* echo 'done';


                exit;*/


            }


            else


            {


                /*print_r(&#036;model-&gt;getErrors()); exit;


                echo '&#33;&#33;&#33;&#33;&#33;&#33;&#33;&#33;&#33;&#33;&#33;';


                exit;*/


            }


            ////print_r(&#036;model-&gt;validators); exit;  


            //print_r(&#036;model-&gt;attributes);


        }


        //&#036;model-&gt;validate();


	// &#036;ww=new Users


        &#036;pages_model=new Pages;


        &#036;welcome_content=&#036;pages_model-&gt;find('page_heading=:page_heading',array(':page_heading'=&gt;'Home'));


        &#036;welcome_content=&#036;welcome_content['page_content'];            //echo &#036;welcome_content;exit;


        &#036;db_cretiria=new CDbCriteria(array('condition'=&gt;'success_couple=:success_couple','params'=&gt;array(':success_couple'=&gt;1),'order'=&gt;'id DESC','limit'=&gt;2));


        //print_r(count(&#036;db_cretiria)); exit;


        &#036;gallery_modle=new Gallery;


        &#036;success_couple=&#036;gallery_modle-&gt;findAll(&#036;db_cretiria);


        foreach(&#036;success_couple as &#036;val)


        {


            &#036;success_couple_array[&#036;val['id']]=&#036;val['image_new_name'];


        }


      


        &#036;religion_model=new Religion;


        &#036;religion=&#036;religion_model-&gt;findAll();


        foreach(&#036;religion as &#036;val)


        {


            &#036;religion_array[&#036;val['id']]=&#036;val['religion'];


        }


        &#036;this-&gt;layout='matrimony';


        //print_r(&#036;model-&gt;getErrors()); exit;


        &#036;this-&gt;render('index',array('welcome_content'=&gt;&#036;welcome_content,'success_couple_array'=&gt;&#036;success_couple_array,'model'=&gt;&#036;model,'religion_array'=&gt;&#036;religion_array));            


      


}

view:

<script type="text/javascript" src="<?php echo Yii::app()->getBaseUrl(true); ?>/js/common_front.js"></script>

<section id="gallery">

	&lt;div class=&quot;gal-slide&quot;&gt;


	&lt;div class=&quot;slider-wrapper theme-default&quot;&gt;


        &lt;div id=&quot;slider&quot; class=&quot;nivoSlider&quot;&gt;


        &lt;img src=&quot;&lt;?php echo Yii::app()-&gt;getBaseUrl(true); ?&gt;/images/slide-1.png&quot; width=&quot;562&quot; height=&quot;350&quot; alt=&quot;slide&quot;&gt;


        &lt;img src=&quot;&lt;?php echo Yii::app()-&gt;getBaseUrl(true); ?&gt;/images/slide-2.png&quot; width=&quot;562&quot; height=&quot;350&quot; alt=&quot;slide&quot;&gt;


        &lt;/div&gt;        


        &lt;/div&gt;


    &lt;/div&gt;


    &lt;div class=&quot;gal-form&quot;&gt;


&lt;div id=&quot;tabs&quot;&gt;


            &lt;ul&gt;


              &lt;li&gt;&lt;a href=&quot;#tab-1&quot;&gt;Register&lt;/a&gt;&lt;/li&gt;


              &lt;li&gt;&lt;a href=&quot;#tab-2&quot;&gt;Search&lt;/a&gt;&lt;/li&gt;


            &lt;/ul&gt;


	


&lt;div id=&quot;tab-1&quot;&gt;


  &lt;?php &#036;form=&#036;this-&gt;beginWidget('CActiveForm', array(


'id'=&gt;'reg-form-reg-form',


'enableAjaxValidation'=&gt;false,

));

// print_r(&#036;model-&gt;getErrors()); 


// print_r(&#036;form-&gt;error(&#036;model,'name'));exit;


  //echo &#036;form-&gt;errorSummary(&#036;model); exit;


  ?&gt;


  	&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;

<tr>

&lt;td&gt;&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'name'); ?&gt;


	&lt;/td&gt;


&lt;td width=&quot;10&quot;&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;


    &lt;?php echo &#036;form-&gt;textField(&#036;model,'name'); ?&gt;


&lt;?php echo &#036;form-&gt;error(&#036;model,'name'); ?&gt;

</td>

</tr>

<tr>

&lt;td&gt;Date Of Birth *&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;


  &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;


  &lt;tr&gt;


    &lt;td width=&quot;84&quot;&gt;


            &lt;?php for(&#036;i=1;&#036;i&lt;=31;&#036;i++){&#036;date[&#036;i]=&#036;i;} ?&gt;


            &lt;?php echo &#036;form-&gt;dropDownList(&#036;model,'date',&#036;date); ?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'date'); ?&gt;


	


    &lt;/td&gt;


    &lt;td width=&quot;84&quot;&gt;


   		


	&lt;?php 


            &#036;month=array('January'=&gt;'January','February'=&gt;'February','March'=&gt;'March','April'=&gt;'April','May'=&gt;'May','June'=&gt;'June','July'=&gt;'July','August'=&gt;'August','September'=&gt;'September','October'=&gt;'October','November'=&gt;'November','December'=&gt;'December');


            echo &#036;form-&gt;dropDownList(&#036;model,'month',&#036;month); ?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'month'); ?&gt;&lt;/td&gt;


    &lt;td&gt;    &lt;?php


            &#036;last_year=date('Y')-18;


            &#036;last_year_last=&#036;last_year-85;


            &#036;year_range=range(&#036;last_year,&#036;last_year_last);


            foreach(&#036;year_range as &#036;val) // atleast 18 age


            {


                &#036;year_val[&#036;val]=&#036;val;


            }


            echo &#036;form-&gt;dropDownList(&#036;model,'year',&#036;year_val);


     echo &#036;form-&gt;error(&#036;model,'year'); ?&gt;&lt;/td&gt;


  &lt;/tr&gt;


&lt;/table&gt;


&lt;/td&gt;

</tr>

<tr>

&lt;td&gt;Gender *&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&lt;label&gt;


  &lt;input type=&quot;radio&quot; name=&quot;Users[gender]&quot; id=&quot;male&quot; value=&quot;male&quot;&gt;


  Male


  &lt;input type=&quot;radio&quot; name=&quot;Users[gender]&quot; id=&quot;male2&quot; value=&quot;female&quot;&gt; 


  Female

</label></td>

</tr>

<tr>

&lt;td&gt;&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'religion'); ?&gt;


	&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&lt;?php echo &#036;form-&gt;dropDownList(&#036;model,'religion',&#036;religion_array,array('class'=&gt;'selet', 'onClick'=&gt;&quot;javascript:list_caste(this);&quot;)); ?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'religion'); ?&gt;&lt;/td&gt;

</tr>

<tr>

&lt;td&gt;&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'caste'); ?&gt;&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&lt;?php echo &#036;form-&gt;dropDownList(&#036;model,'caste',array(''=&gt;'select religion'),array('class'=&gt;'selet',)); ?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'caste'); ?&gt;


&lt;/select&gt;&lt;/td&gt;

</tr>

<tr>

&lt;td&gt;&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'mobile'); ?&gt;&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;


  &lt;tr&gt;


    &lt;td&gt;&lt;select name=&quot;date6&quot; id=&quot;date6&quot;&gt;&lt;option value=&quot;+91&quot;&gt;+91&lt;/option&gt;


    &lt;/select&gt;&lt;/td&gt;


    &lt;td&gt;&lt;?php echo &#036;form-&gt;textField(&#036;model,'mobile',array('class'=&gt;'mobile')); ?&gt;


    &lt;?php echo &#036;form-&gt;error(&#036;model,'mobile'); ?&gt;&lt;/td&gt;


  &lt;/tr&gt;


&lt;/table&gt;&lt;/td&gt;

</tr>

<tr>

&lt;td&gt;&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'email'); ?&gt;&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&lt;?php echo &#036;form-&gt;textField(&#036;model,'email'); ?&gt;


&lt;?php echo &#036;form-&gt;error(&#036;model,'email'); ?&gt;&lt;/td&gt;

</tr>

<tr>

&lt;td&gt;&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'password'); ?&gt;&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&lt;?php echo &#036;form-&gt;passwordField(&#036;model,'password'); ?&gt;&lt;/td&gt;

</tr>

<tr>

&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&lt;label&gt;


      &lt;?php echo CHtml::submitButton('Register Free',array('class'=&gt;'subt')); ?&gt;


  


&lt;/label&gt;&lt;/td&gt;

</tr>

</table>

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





&lt;/div&gt;


      


&lt;div id=&quot;tab-2&quot;&gt;

<form action="search.php" method="get">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

&lt;td&gt;Looking For&lt;/td&gt;


&lt;td width=&quot;10&quot;&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;


    &lt;select class=&quot;selet&quot; name=&quot;listbox&quot; id=&quot;listbox&quot;&gt;


      &lt;option&gt;Bride&lt;/option&gt;


      &lt;option&gt;Groom&lt;/option&gt;


    &lt;/select&gt;


&lt;/td&gt;

</tr>

<tr>

&lt;td&gt;Age&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;


  &lt;tr&gt;


    &lt;td width=&quot;112&quot;&gt;&lt;select name=&quot;listbox2&quot; id=&quot;listbox2&quot;&gt;


      &lt;option&gt;select&lt;/option&gt;


      &lt;option&gt;18&lt;/option&gt;


    &lt;/select&gt;&lt;/td&gt;


    &lt;td width=&quot;57&quot;&gt;To&lt;/td&gt;


    &lt;td&gt;&lt;select name=&quot;listbox3&quot; id=&quot;listbox3&quot;&gt;


      &lt;option&gt;Select&lt;/option&gt;


      &lt;option&gt;22&lt;/option&gt;


    &lt;/select&gt;&lt;/td&gt;


  &lt;/tr&gt;


&lt;/table&gt;&lt;/td&gt;

</tr>

<tr>

&lt;td&gt;Height(CM)&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;


  &lt;tr&gt;


    &lt;td width=&quot;112&quot;&gt;&lt;select name=&quot;listbox4&quot; id=&quot;listbox4&quot;&gt;


      &lt;option&gt;select&lt;/option&gt;


      &lt;option&gt;18&lt;/option&gt;


    &lt;/select&gt;&lt;/td&gt;


    &lt;td width=&quot;57&quot;&gt;To&lt;/td&gt;


    &lt;td&gt;&lt;select name=&quot;listbox4&quot; id=&quot;listbox5&quot;&gt;


      &lt;option&gt;Select&lt;/option&gt;


      &lt;option&gt;22&lt;/option&gt;


    &lt;/select&gt;&lt;/td&gt;


  &lt;/tr&gt;


&lt;/table&gt;&lt;/td&gt;

</tr>

<tr>

&lt;td&gt;With Photo&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;


  &lt;tr&gt;


    &lt;td&gt;&lt;label&gt;


      &lt;input type=&quot;checkbox&quot; name=&quot;tick&quot; id=&quot;tick&quot; /&gt;


    &lt;/label&gt;&lt;/td&gt;


    &lt;td&gt;&lt;label&gt;


      &lt;input class=&quot;subt&quot;  type=&quot;submit&quot; name=&quot;button&quot; id=&quot;button&quot; value=&quot;Search&quot; /&gt;


    &lt;/label&gt;&lt;/td&gt;


  &lt;/tr&gt;


&lt;/table&gt;&lt;/td&gt;

</tr>

<tr>

&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;

</tr>

<tr>

&lt;td&gt;Member id&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&lt;label&gt;


  &lt;input type=&quot;text&quot; name=&quot;textfield&quot; id=&quot;textfield&quot; /&gt;


&lt;/label&gt;&lt;/td&gt;

</tr>

<tr>

&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&amp;nbsp;&lt;/td&gt;


&lt;td&gt;&lt;input class=&quot;subt&quot; type=&quot;submit&quot; name=&quot;button2&quot; id=&quot;button2&quot; value=&quot;Search&quot; /&gt;&lt;/td&gt;

</tr>

</table>

</form>

&lt;/div&gt; 

</div>

    &lt;/div&gt;


&lt;/section&gt; 


&lt;section id=&quot;content&quot;&gt;


	&lt;div class=&quot;left&quot;&gt;


    	&lt;div class=&quot;text&quot;&gt;


                &lt;?php echo &#036;welcome_content; ?&gt;


            &lt;/div&gt;


        


        &lt;div class=&quot;premia&quot;&gt;


        &lt;h2&gt;Premium Display&lt;/h2&gt;


        	&lt;ul&gt;


            &lt;li&gt;


            &lt;img src=&quot;&lt;?php echo Yii::app()-&gt;getBaseUrl(true); ?&gt;/images/pre.png&quot; width=&quot;130&quot; height=&quot;79&quot; alt=&quot;groum&quot;&gt;


            &lt;span&gt; &lt;span class=&quot;name&quot;&gt;Sasi &lt;/span&gt;&lt;span class=&quot;yer&quot;&gt;25yrs&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;id&quot;&gt;Profile ID : MI-230001 &lt;/span&gt;


            &lt;/li&gt;


            &lt;li&gt;&lt;img src=&quot;&lt;?php echo Yii::app()-&gt;getBaseUrl(true); ?&gt;/images/pre.png&quot; width=&quot;130&quot; height=&quot;79&quot; alt=&quot;groum&quot;&gt;&lt;span&gt; &lt;span class=&quot;name&quot;&gt;Sasi &lt;/span&gt;&lt;span class=&quot;yer&quot;&gt;25yrs&lt;/span&gt;&lt;/span&gt;


              &lt;span class=&quot;id&quot;&gt;Profile ID : MI-230001 &lt;/span&gt;&lt;/li&gt;


            &lt;li&gt;&lt;img src=&quot;&lt;?php echo Yii::app()-&gt;getBaseUrl(true); ?&gt;/images/pre.png&quot; width=&quot;130&quot; height=&quot;79&quot; alt=&quot;groum&quot;&gt;&lt;span&gt; &lt;span class=&quot;name&quot;&gt;Sasi &lt;/span&gt;&lt;span class=&quot;yer&quot;&gt;25yrs&lt;/span&gt;&lt;/span&gt;


              &lt;span class=&quot;id&quot;&gt;Profile ID : MI-230001 &lt;/span&gt;&lt;/li&gt;


            &lt;li&gt;&lt;img src=&quot;&lt;?php echo Yii::app()-&gt;getBaseUrl(true); ?&gt;/images/pre.png&quot; width=&quot;130&quot; height=&quot;79&quot; alt=&quot;groum&quot;&gt;&lt;span&gt; &lt;span class=&quot;name&quot;&gt;Sasi &lt;/span&gt;&lt;span class=&quot;yer&quot;&gt;25yrs&lt;/span&gt;&lt;/span&gt;


              &lt;span class=&quot;id&quot;&gt;Profile ID : MI-230001 &lt;/span&gt;&lt;/li&gt;


            &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;


            &lt;/ul&gt;


        &lt;/div&gt;


    &lt;/div&gt;


    &lt;div class=&quot;right&quot;&gt;


 		&lt;div class=&quot;sucouple&quot;&gt;


		&lt;h3&gt;Success Couples&lt;/h3&gt;


  		&lt;ul&gt;


                  &lt;?php


                  &#036;base= Yii::app()-&gt;getBaseUrl(true);


                  //print_r(&#036;success_couple_array);


                  foreach(&#036;success_couple_array as &#036;val)


                  {


                      


                      echo &quot;&lt;li&gt;&lt;img src=&#092;&quot;&#036;base/gallery/thumb/&#036;val&#092;&quot; width=&#092;&quot;199&#092;&quot; height=&#092;&quot;124&#092;&quot; alt=&#092;&quot;couples&#092;&quot;&gt;&lt;/li&gt;&quot;;


                  }


                  ?&gt;


   	  		


              


          &lt;/ul&gt;


        &lt;/div&gt;


    &lt;/div&gt;


    &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;


&lt;/section&gt;

Seems like this is how CActiveForm::error() works. It is used for ajax validation.

I’ve always disliked activeform, so no idea how to turn this off.