CActiveForm and clientChange() submit problem

Hi,

I try to create linkButton inside CActiveForm widget, for example:


echo CHtml::linkButton('link', array('submit' => '', 'params' => array('test'=> 1) ))

As you see, I would like to submit this form after clicking at ‘link’.

But it doesn’t work INSIDE form. When I replace this code OUTSIDE form it works! :-[

Any ideas?

Regards,

gawronzo

Hello,

I encountered the same problem with a dropdown list .

It’s not beautifull but works : do a js click() on your submit button




echo CHtml::linkButton('link', 

   array('onClick'=>'$(\'#yourFormId\').attr(\'action\' , function(){return this.action + \'&test=1\'});

            $(\'#submit\').click();',)

)



I adapted your code but haven’t tested it !

for multiple roundtrip (validation, refresh), delete the parameters by forcing action in CActiveForm




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

      'id'=>$formId,

      'enableAjaxValidation'=>false,

      'action'=>CHtml::normalizeUrl(array('/path/to/action')),

)); 

?>

hope this help