Yii Framework Forum: CActiveForm and clientChange() submit problem - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CActiveForm and clientChange() submit problem Rate Topic: -----

#1 User is offline   gawronzo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 40
  • Joined: 10-November 09
  • Location:Poland/Lublin

Posted 04 June 2010 - 05:36 AM

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
0

#2 User is offline   cma 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 28-July 09

Posted 26 July 2010 - 04:46 PM

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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users