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'),
array(
'empty' => 'Select Work',
)
); ?>
</div>
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>
</select>