June 22, 2010, 11:05am
I wanted to use CForm to create an Ajax-based form. However, it seems that CFormButtonElement doesnt support ajaxButton’s.
I added the ajaxButton support to CFormButtonElement. However, my guess is that it wasnt already there due to a reason.
Anyone knows why CFormButtonElement doesnt support CHtml::ajaxButton()? would my patch be welcome? If yes i’ll post it here.
February 5, 2011, 9:16am
February 5, 2011, 9:31am
From the api doc
The type property can also be a class name or a path alias to the class.
In this case, the button is generated using a widget of the specified class.
Note, the widget must have a property called "name".
how to set this,I wanna an ajaxsubmit button
November 26, 2011, 12:54am
i’ve got the solution.
assign key ‘attributes’ to your button with an array as value
assign key ‘ajax’ in array attributes and configure linke ajaxButton, ajaxSubmitButton.
'buttons' => array(
'login' => array(
'type' => 'submit',
'label' => 'Speichern',
'attributes' => array(
'class' => 'submit',
'ajax' => array(
'type' => 'POST', //request type
'url' => Yii::app()->createUrl($this->getId() . '/AjaxTest'), //url to call.
'update' => '#content', //selector to update