Ajax Not Response

  1. open page admin.php is renderpartial _active.php

  2. input PIN and click Search then <div> content is renderpartial _activeform.php

  3. when I click active (on _activeform.php) but in ajax request alway to "Customers/Popup" not "Customers/Active"

How to fix it?

admin.php




<?php

...

...

...

<div class="span8">

   <?php $this->renderPartial('_active'); ?>

</div>

<?php

$this->endWidget();

?>



_active.php




...

...

...

        echo $form->textField(Customers::model(), 'PIN', array());

        echo "\t";

        $this->widget('bootstrap.widgets.TbButton', array(

            'buttonType' => 'submit',

            'label' => 'Search',

            'htmlOptions' => array(

                'ajax' => array(

                    'type' => 'POST',

                    'url' => CController::createUrl('Customers/Popup'),

                    'update' => '#detail',

                    'data' => array(

                        'pin' => 'js:$("#Customers_PIN").val()',

                    )

                )

            )

        ));

        ?>

    </div>

</div>

<div class="grid-view"></div>

<div id="detail">

</div>


<?php

$this->endWidget();

?>



_activeform.php




....

....

....

                    } else {

                        $this->widget('bootstrap.widgets.TbButton', array(

                            'type' => '',

                            'label' => 'active',

                            'buttonType' => 'submit',

                            'htmlOptions' => array(

                                'ajax' => array(

                                    'type' => 'POST',

                                    'url' => CController::createUrl('Customers/Active'),

                                    'update' => '#side.load()',

                                    'data' => array(

                                        'pin' => $rs['PIN'],

                                    )

                                )

                            ),

...

...

...



Controller.php




public function actionPopup() {

        $PIN = $_POST['pin'];

        $rs = Customers::model()->checkBooker($PIN);

        $this->renderpartial('_activeform', array('rs' => $rs));

    }

public function actionActive() {

        Customers::model()->setActive($pin);

        print_r($pin);

    }



can everyone help????