ajaxSubmitButton works as normal submitButton

Hi!

I’m trying to submit a form using ajaxSubmitButton, but instead it submits as if there was a normal submit.

Here’s the code from the view file:


<?php

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

        'id' => 'msg-messages-index-form',

        'enableAjaxValidation' => false,

            ));

    ?>

        

        

    <?= $form->errorSummary($replymessage); ?>

    <div class="row rel-container replymessagetext">

        <?= $form->textArea($replymessage, 'text', array('class' => 'overlayed')); ?>

        <?= $form->label($replymessage, 'text', array('class' => 'label-overlay')); ?>

    </div>

    <div class="row buttons replymessagebuttons">

        <?=

        CHtml::ajaxSubmitButton(

             'Send', 

             '/messages/reply', 

             array(

                   'update' => '#' . $thread_id . ' .replyform',

                   'type' => 'POST',

                ), 

             array('class' => 'greybutton')

        )

        ?>

    </div>

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

I’ve been stuck with this for couple of hours now and just can’t find what’s causing this problem.

What could be wrong here?

My content that contains ajaxsubmitbutton was also being loaded with ajax request.

Solved using this tip:

http://www.yiiframework.com/forum/index.php/topic/23847-easy-way-to-make-ajax-submit-for-the-cactiveform/page__view__findpost__p__118946

I simply overrode renderPartial method in my controller:


public function renderPartial($view, $data = null, $return = false) {

    CController::renderPartial($view, $data, $return, true);

}