How To Insert Selected Item In Dropdownlist To Database In Yii

he guys help me

I need to insert sekected item in dropdown list to do I do that

 <?php echo $form->dropDownList($model,'type',array('prompt'=>'Select Type','1'=>'Phone','2'=>'E-mail'),array('class' => 'dropDownBox')); ?>

how to save database when user select what ever item in above me

thanx in advance


Post it to an action!!

Can you give me sample code pls

what is your purpose?

If you use Gii tools, You don’t need any thing for saving. It generate all the codes you need it. It is so easy to make a huge of models, controllers, views and CRUD.

I need when user select phone option it shoul save in the database as phone and when user select telephone it shoud save in the database as telephone like wise .how to do that??

my contraller is like this


Applyjob is Cform model


echo CHtml::dropDownList('2','select_value',$data,array('prompt'=>'Move To Folder','class'=>'styled','submit'=>array('user/inbox','p'=>'1')));

note the ‘submit’

your exampke is not clear.anyway thanx.if someone can help me it is really appreciate


here user/inbox is the action.

In the model file you define 2 constant for 1=mobile, 2=telephone etc.

And in the controller file:


    	case Model::mobile:



     	case Model::telephone: