another ajax dropdownlist problem

Hi,

I’m testing ajax features and I’m having a problem getting a dependant dropdownlist to work.

This is my form page :

<div class="row">

	&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'langId'); ?&gt;


	&lt;?php 


	


		echo &#036;form-&gt;dropDownList(&#036;model,'langId',array('1'=&gt;'English', '2'=&gt;'Bangla'),array(


                            'id'=&gt;'langId',


			'ajax' =&gt; array(


                            'type'=&gt;'POST',


                            'url'=&gt;CController::createUrl('birthRegDtl/dynamiclang'),


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


							),


                         'ajax' =&gt; array(


                            'type'=&gt;'POST',


                            'url'=&gt;CController::createUrl('birthRegDtl/dynamiclangR'),


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


							)

));

?>

	&lt;?php echo &#036;form-&gt;error(&#036;model,'langId'); ?&gt;

</div>

<div class="row">

	&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'religionId'); ?&gt;


	&lt;?php echo &#036;form-&gt;dropDownList(&#036;model,'religionId',array()); ?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'religionId'); ?&gt;


&lt;/div&gt;

<div class="row">

	&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'prCountryId'); ?&gt;


		&lt;?php  


		echo &#036;form-&gt;dropDownList(&#036;model,'prCountryId',array()); 


		?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'prCountryId'); ?&gt;


&lt;/div&gt;

here is my controller page…

public function actionDynamiclang() {

		 &#036;data=MstCountry::model()-&gt;findAll('lang=:lang',


         array(':lang'=&gt;(int) &#036;_POST['BirthRegDtl']['langId']));


		echo CHtml::tag('option',


                           array('value'=&gt;''),'Please select a country.',true);


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


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


            {


                echo CHtml::tag('option',


                           array('value'=&gt;&#036;value),CHtml::encode(&#036;country),true);


            }			


    }

public function actionDynamiclangR() {

		 &#036;data=MstReligion::model()-&gt;findAll('lang=:lang',


         array(':lang'=&gt;(int) &#036;_POST['BirthRegDtl']['langId']));


		echo CHtml::tag('option',


                           array('value'=&gt;''),'Please select a Religion.',true);


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


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


            {


                echo CHtml::tag('option',


                           array('value'=&gt;&#036;value),CHtml::encode(&#036;religion),true);


            }			


    }

I want to change the value of Country ang religion field if change lanuage filed

what can I do for this. please any one help me…

I have not read your code… as it’s very unreadable… please use the <> button (code button) when inserting code… but on the forum there are already many topic about dependent dropdowns… please search a bit… maybe some of them will help you…

and

have you read this wiki… and tried that example to get some experience and to understand how this is working…