Ajax dependent dropdownlist isnt working

Hi I tried to create dependent dropdownlist, here is my code :

_form.php




<div class="row">

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

    <?php echo $form->dropDownList($model,'kode_program',

        $list_prog,array(

        'prompt'=>'--Pilih--',

            'ajax' => array(

                        'type'=>'POST',

                        'url'=>CController::createUrl('OPS/loadKegiatan'),

                        'update'=>'#'.CHtml::activeId($model,'kode_kegiatan')

        ))


        ); ?>


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

</div>


<div class="row">

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

    <?php 

    echo $form->dropDownList($model, 'kode_kegiatan', array(), array('prompt' => '--Pilih--'));

     ?>

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

</div>

code in controller OPSController.php


    public function actionLoadKegiatan()

        {

            $kode_program = $_POST['OPS']['kode_program'];

            $data=Subjects::model()->findAll('kode_program=:kode_program',

                        array(':kode_program'=> $kode_program));


            $data=CHtml::listData($data,'kode_kegiatan','nama_kegiatan');

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

                    echo CHtml::tag('option',

                       array('value'=>$value),CHtml::encode($name),true);

            }

       }

The code doesn’t show any error but it isnt working. I guess the ajax request failed to call the controller action but i dont know why. Please help me. Thank you.

You can see the response to a request by using your browser’s development tools or Fiddler.