I am using Yii and I have a form wrapped in tabs. In one of these tabs I need to put a link (call a controller/action with parameters) independent from the form content.
I've tried to use CHtml::linkButton but it doesn't work.
The code scheme of the form is the following:
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'project-form',
'enableAjaxValidation'=>true,
)); ?>
//...input elements
<?php echo CHtml::linkButton('Download',
array(
'submit'=>$this->createUrl('controller/action'),
'params'=>array(
'results'=>CJSON::encode(array('foo'=>'bar'))
))
); ?>
//...other input elements
<?php $this->endWidget(); ?>
When I click on the link nothing happens. If I put the linkButton code outside the form it works properly.
Is there a workaround for this?