Search code examples
phptwitter-bootstrapyiihttp-postrenderpartial

Yii TbTabs widget with render partials what happened with $_post request


I'm using tbTabs, but when submit, only the first tab _audio view get $_post request. what happened with other render partials view's $_post data?

create.php

Contain

$this->widget('bootstrap.widgets.TbTabs', array(
    'tabs'=>array(
        array(
            'id'=>'tab1',
            'active'=>true,
            'label'=>'audio',
            'content'=>$this->renderPartial("_audio", array('model' => $model),true),            
        ),
        array(
            'id'=>'tab2',
            'active'=>false,
            'label'=>'videos',
            'content'=>$this->renderPartial("_videos", array('model' => $model),true),
        ),

        array(
            'id'=>'tab3',
            'active'=>false,
            'label'=>'games',
            'content'=>$this->renderPartial("_games", array('model' => $model),true),

        ),        
    ),
)); 

Solution

  • If there are three separate forms in the tabs, they are independent of each other.

    You will need to use JavaScript/jQuery to post the three forms via AJAX, before refreshing/redirecting the page.