Getting value from dropDownList

I have this code in my view that search for the work position listed in the database (work_tbl). My question is how can I get what the user has selected in the dropDownList and save it to another table named users_tbl…? I only want to get the work_id from the dropDownList.

I also have 2 model: UserModel and WorkModel

<div class="row">

<?php echo $form->dropDownList($modelwork,'work_id', CHtml::listData(Work::model()->findAll(), 'work_id', 'work'),


		'empty' => 'Select Work',


); ?> 


Thanks! :)

Just like in native php, I want to get the name (example below: work_dropdown) of the dropdownlist :) How can I do that in Yii?

<select name="work_dropdown">

   <option value="php">Native Php Developer</option>

   <option value="yii">Yii Developer</option>

   <option value="qa">Quality Assurance</option>


You can just get the values of ModelWork in your controller. It should be populated with the "work_id" that the user has selected.

Please take a look at the "Working with Forms" sections of the guide.

Thank you!