Chtml:
echo CHtml::dropDownList('country_id','2', array(1=>'USA',2=>'France',3=>'Japan'),
array(
'ajax' => array(
'type'=>'POST', //request type
'url'=>Yii::app()->createUrl('site/dynamiccities'),
'update'=>'#city_id', //selector to update
//'data'=>'js:javascript statement'
//leave out the data key to pass all form values through
)));
//empty since it will be filled by the other dropdown
echo CHtml::dropDownList('city_id','', array(1));
<?php echo CHtml::dropDownList('parentid', $model->parentid, $this->cate_list);?>
Form:
<?php echo $form->dropDownList($model,'parentid',CHtml::listData(Category::model()->findAll(),'id','category'), array('empty'=>array(0=>'Select location'),'options' => array('2'=>array('selected'=>true)))); ?>