How To Create Dependent Dropdownlists

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


<div class="row">



<?php echo $form->labelEx($model,'Merchant or Brand',array('style'=>'display:inline','margin-left'=>"20px")); ?>



<?php echo CHtml::activeDropDownList($model,'merchant',Merchant::model()->Merchant,array(

'ajax' => array(








<tr id="merchantcity">



<?php echo CHtml::activeDropDownList($model,'citylist', array()); ?>




controller action

public function actiondynamiccities(){



foreach($data as $value=>$name)


	echo CHtml::tag('option',




is there any error in your browser console if you are getting a js error post that too that might help to track the problem one cannot figure out by looking at the code

i don’t knw how but now its working i was working on it from the past 4 hours, any way thanks alot for your response :)