Customized Error

Hi Guys!!!,

     I have a form which stores the user details. In this form there is one field that is not belongs to that particular USER model. So currently, I am handling error for this field using Javascript's alert box. But I want to use YII Error message for this field. In USER model, this field is not defined. Can you please guide me on urgent basis??

Note :

echo CHTML::textField(‘usr_total’,’’,array(‘size’=>25, ‘maxlength’=>25,));

Storing Value of this field in other table using $_POST.

In model add

 public $usr_total;

then you can use this as a model field.

In model rules add

array('usr_total', 'required'),

See the contact form model for reference.

Is there any other way to to display without adding a variable in model file?

chekk this wiki