Searching using a DropDown, in the admin view quick search

I have the following scenarion

I have 2 mysql tables where I need to search within,

In the 2nd table I have a column with name type with contains numbers 1-4, 1 = Normal user, 2 = Sales user etc. Now the corresponding text is not in the database, the text that belong to these values are defined as constants and thats why I need to dropdown. now if I select a value in the dropdown list the search is not executing

My view looks like this

$this->widget('zii.widgets.grid.CGridView', array(
































)); ?>

The search within the model looks like below, please note that the value selected is nopt pulling throug to criteria->addInCondition(‘acl.type’,array($this->acl_id)); , if I replace $this->acl_id with a number the search works, but this needs to be dynamic,


	 * 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.

		$criteria=new CDbCriteria;

		$criteria->with = array('region','acl');















		return new CActiveDataProvider('user', array(




Hello, I am new in web programming, but I am using dropdown in the admin page, but the problem is that when I select a option of the list, this erase automatically, this is the code of the view

and this is the code of the search

Thanks in advance.

You have to set the field as safe.

Edit the function rules of the model, add this field to the list:

array('field1, field2', 'safe', 'on'=>'search')