ajax dropdownlist problem


i am new in yii framework and having problem with dynamic dropdownlist

wanted to set dynamic values on two fields depends on one field like

when i select country from country dropdown then

i want dyanmic value set in city dropdown and price range dropdown


country is parent

city child

price range child

so need help urgently

thank you in advance

Check this http://www.yiiframework.com/wiki/24/creating-a-dependent-dropdown

thanks for reply

but my problem not solved yet you can check here on my site


here you can go to rightside search

select country it will load city at that time while loading city <br />

i want to set price range for the slider of price range near search button you can see

so i want to set value at 2 places while selecting country<br />

thank you

The article shows you that you can actually make an ajax call, that ajax command is setup with the same options as the jquery options. So, what you need to do is setup the ‘success’=>‘js:yourfunctiontohandleajaxresponse’, same way as in the docs of jquery and do whatever you wish with the command.

sorry for trouble but i am not getting how it will work

here is my code

===view code ==


      &#036;country = new CDbCriteria;

      &#036;country-&gt;order = 'CountryName ASC';  

	  &#036;country-&gt;condition = 'CountryName&#33;=&quot;&quot;';  

      echo &#036;form-&gt;dropDownList(&#036;model,'CountryID',CHtml::listData(Country::model()-&gt;findAll(&#036;country),'CountryID','CountryName'),array('class'=&gt;'formList',


                    'ajax' =&gt; array(

                    'type' =&gt; 'GET',

                    'url' =&gt; CController::createUrl('property/dynamiccity'),

					'update' =&gt;'#'.CHtml::activeId(&#036;model,'CityID')






	 &#036;city = new CDbCriteria;

      &#036;city-&gt;order = 'CityName ASC'; 

	&#036;city-&gt;condition = 'CityName&#33;=&quot;&quot;'; 

echo &#036;form-&gt;dropDownList(&#036;model,'CityID',array(&quot;&quot;=&gt;&quot;City&quot;),array('class'=&gt;'formList','ajax' =&gt; array('type' =&gt; 'GET','url' =&gt; CController::createUrl('property/dynamicprojects'),'update' =&gt;'#'.CHtml::activeId(&#036;model,'ProjectID')


          )); ?&gt;

this is my slider field here i want to set value

<input id="Slider5" type="slider" name="area" value="0;1000" style="display: none; ">

===end view code ==

===controller action ===

public function actionDynamiccity()


	  &#036;criteria = new CDbCriteria;

	  &#036;criteria-&gt;condition = &quot;CountryID='&quot;.&#036;_GET['Properties']['CountryID'].&quot;'&quot;;

	  &#036;data = City::model()-&gt;findAll(&#036;criteria);


	 &#036;data = CHtml::listData(&#036;data,'CityName','CityName');

	  echo CHtml::tag('option',array('value'=&gt;0),CHtml::encode('City'),true);

	  foreach(&#036;data as &#036;value=&gt;&#036;name)


		echo CHtml::tag('option',array('value'=&gt;&#036;value),CHtml::encode(&#036;name),true);




===end action=====

can you please tell me how to pass price range from this action from here only the <option …>value</option> returning

thanks in advance