AjaxSubmitButton works only once


I am new to the YII. I created one ajaxSubmitButton but on clicking this button ajax works only once. Second time ajax is not calling. Please help me out regatding this.



This is a known bug and i think, there's no ultimate solution to it yet:


I did a small investigation and I think I found some useful information which can help us. I’ve added them as a comment to ticket #38

Any progress? Basically just at the early stages of my app. Decided to do the registration process first. It's a multi-page business registration, so I designed it to load each stage via the ajax submit…and then discovered tonight that once fired, no subsequent 'overlays' will load…doesn't fire at all.

Hi, there.

I came across the same problem.

I see there are many comments and suggestions about this problem over the forums.

But it has not been solved as of Yii 1.0.6.

(It's almost 6 months past…)

I decide not to use CHtml::ajaxXXX methods.

Instead, I write my own javascripts with using jQuery Form plugin.


Just my two cents.


I have come across the same problem. I am currently using Yii 1.0.10.r1472.

A quick and easy solution to the problem is not to use ‘replace’=>‘somediv’ or ‘update’=>‘somediv’ but instead use the ‘success’ function do something like

echo CHtml::ajaxSubmitButton(‘save’, ‘settings/’, array(‘type’=>‘POST’, ‘success’=>“function(data) { updatePanel(data, ‘$id’) }”))

and then implement a javascript function lke the following

<script type="text/javascript">

function updatePanel( data, id ) {