Yii populate a dropdown on select of another
问题 I have a dropdown that I want to populate when an item in another dropdown is selected. Both the dropdown are tied to data/model passed on from controller. and the first dropdown is populated from DB by calling a function in the model. Heres' the form, echo $form->dropDownListRow($modelunit, 'superunit', $model->getSunits(), array( 'ajax' => array( 'type'=>'POST', 'url'=>CController::createUrl('user/getunits'), 'update'=>'#unit_id', ))); echo CHtml::dropDownList('unit_id','', array()); Here's