i have studied a lot but can’t solve this problem i have followed this wiki but its not working for me here is my code can any one find where i am doing mistake plzz
form
<div class="row">
<tr>
<th>
<?php echo $form->labelEx($model,'Merchant or Brand',array('style'=>'display:inline','margin-left'=>"20px")); ?>
</th>
<td>
<?php echo CHtml::activeDropDownList($model,'merchant',Merchant::model()->Merchant,array(
'ajax' => array(
'type'=>'POST',
'url'=>Yii::app()->createUrl('search/dynamiccities'),
'update'=>'#'.CHtml::activeId($model,'citylist'),
)));
?>
</td>
</tr>
<tr id="merchantcity">
<td></td>
<td>
<?php echo CHtml::activeDropDownList($model,'citylist', array()); ?>
</td>
</tr>
</div>
controller action
public function actiondynamiccities(){
$data=Merchant::model()->findAll(true);
$data=CHtml::listData($data,'id','name');
foreach($data as $value=>$name)
{
echo CHtml::tag('option',
array('value'=>$value),CHtml::encode($name),true);
}
}