Ajax dependent dropdownlist isnt working

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


<div class="row">

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

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



            'ajax' => array(





        ); ?>

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


<div class="row">

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


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


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


code in controller OPSController.php

    public function actionLoadKegiatan()


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


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


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

                    echo CHtml::tag('option',




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.