Alexandrino
(Davi Alexandrino)
September 2, 2009, 1:03pm
1
Hi everyone;
First, wannna tell that I did search hard for this solution here, but nothing found. I would like to reset a form after submiting with CHtml::ajaxSubmitButton. I try use onclick in htmlOptions array, but this event occurs before submit; so nothing is sent. Somebody can help me?
Dave
(Deventer)
September 2, 2009, 1:47pm
2
Do you have some code for us? Its hard to identify errors or problems without having a piece of related code.
You can specify ajaxOptions for the ajaxSubmitButton. (http://www.yiiframework.com/doc/api/CHtml#ajaxSubmitButton-detail )
I think you can do some like
$ajaxOptions = array();
$ajaxOptions['success'] = "$('#formId').reset()"
Where ‘formId’ is the id of your form tag.
sebas
(Sebathi)
September 2, 2009, 4:42pm
3
Dave:
Do you have some code for us? Its hard to identify errors or problems without having a piece of related code.
You can specify ajaxOptions for the ajaxSubmitButton. (http://www.yiiframework.com/doc/api/CHtml#ajaxSubmitButton-detail )
I think you can do some like
$ajaxOptions = array();
$ajaxOptions['success'] = "$('#formId').reset()"
Where ‘formId’ is the id of your form tag.
For $ajaxOptions[‘succes’] you need to send a full qualified callback function.
Try this:
$ajaxOptions = array('succes'=>'function(e,u) { $("#formId").reset(); }');