Fail to update fields using dropdownlist ajax and json

Hi my fellow Yii members,

I have this problem for more than two days now. I cant replace these two field when the dropdown value is changed using ajax and json. Please help me where I went wrong

My view code is:

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(



)); ?>


	<?php echo $form->errorSummary($model); ?>

	<table cellpadding="0" cellspacing="0">


	<td><div class="row"><?php echo $form->dropDownList($model,'objid',$model->getObjectives(),


	'ajax'=>  array(

                 'type'=>'POST', //request type


                  'url'=>CController::createUrl('activities/getKT'), //url to call.









    <tr><th>KPI/Measures</th><td><span id="kpi"></span></td></tr>

	<tr><th>Targets</th><td><span id="targets"></span></td></tr>


	<td><div class="simple">

		<?php $this->widget('ext.widgets.xheditor.XHeditor',array(





        'tools'=>'simple', // mini, simple, mfull, full or from XHeditor::$_tools, tool names are case sensitive

        'skin'=>'o2007blue', // default, nostyle, o2007blue, o2007silver, vista





)); ?>



	<td><div class="simple"><?php echo $form->textField($model,'weight',array('size'=>8,'maxlength'=>5)); ?></div></td></tr>


		<?php echo CHtml::submitButton($model->isNewRecord ? 'Save' : 'Update'); ?>


<?php $this->endWidget(); ?>

</div><!-- form -->

My controller code:

public function actiongetKT()


	  $objid = $_POST['Activities']['objid'];

	  $data = Yii::app()->db->createCommand("SELECT kpi,targets FROM objectives WHERE objid='$objid'")->queryRow(false);

	  echo CJSON::encode(array(





You need to use a tool like firebug to check if the ajax call has been made at all… and if it is… than to check what is returned by the call…