After Adding Theme, Dependant Dropdown Is Not Working

Hi guys,

I’m developing a web application using yii. I have developed it in basic(default) theme. Everything works fine. But after adding a template, dependant dropdowns are not working. I mean after selecting a value in district, the respective taluks are not showing in second dropdown. Earlier it was working fine, but now its not working. Could somebody help me please…

Here is my code in view(_form.php) :


<div class="row">

		<?php echo $form->labelEx($model,'district_id'); ?>

		<?php echo $form->dropDownList($model, 'district_id', $model->getDistrict(), array(

                          'prompt' => 'Select district',

                          'ajax' => array(

                          'type' => 'POST',

                          'url' => CController::createUrl('taluqs'),

                          'update' => '#Inquiry_taluq_id',

                          

                                          )

                  )); ?>

		<?php echo $form->error($model,'district_id'); ?>

	</div>


	<div class="row">

		<?php echo $form->labelEx($model,'taluq_id'); ?>

		<?php echo $form->dropDownList($model,'taluq_id',array(),array('empty'=>'Select taluk')); ?>

		<?php echo $form->error($model,'taluq_id'); ?>

	</div>

In my controller :


public function actionTaluqs() {


$taluqs = Taluq::model()->findAll('district_id=:district_id', array(':district_id' => (int) $_POST['Inquiry']['district_id']));

$return = CHtml::listData($taluqs, 'taluq_id', 'taluq_name');

foreach ($return as $taluqId => $taluqName) {

echo CHtml::tag('option', array('value' => $taluqId), CHtml::encode($taluqName), true);

}

}

In my model :


public function getDistrict()

          { 

             //this function returns the list of categories to use in a dropdown        

             return CHtml::listData(District::model()->findAll(), 'district_id', 'district_name');

          }

         public function getTaluq()

          { 

             //this function returns the list of categories to use in a dropdown        

             return CHtml::listData(Taluq::model()->findAll(), 'taluq_id', 'taluq_name');

          }

Sounds like issue related jquey. If you do not use built-in jquery.js library, you need to set false js files in components array in main.php in config directory eg. -


'clientScript'=>array(

  'class'=>'CClientScript',

	'scriptMap'=>array(

		'jquery.js'=>false, //set false if you don't wish

               ) 

            ) 

Please first determine conflict js files and then set false.