ajax multiple submission


I read this tutorial,


it is a great one,


it submits the form 2 times, and sometimes 3 times.

the author has added a comment, which does not seem to solve the problem.

/*This will fix multiple ajax submittion problem */

/* Use the below undelegate function to destroy JQuery event. 

Otherwise when you open dialog 1st time, It will do ajax submission 1 time, 

if you open 2end time, It will submit 2 times etc.. 

You could see the ajax submission in firebug */ 





'title'=>Yii::t("dma",'CREATE DMA'), 





'resizable' =>false, 


jQuery('body').undelegate('#closeDmaDialog', 'click');





this solution does not help at all.

the tutorial is really good benefit, but this error looks like the fly in the ointment, big fly.

any suggestions?

try something like this:






Thank you Ekstazi for your reply,

I tried it and have no effect.


I will correct myself,

that tutorial was not great. it wasn’t even good.

if it was good, then what would we call this one?


it is very very very simple, smart, and straight forward.

very suitable for beginners

Hi, Aladdin. Can you explain please how you have solved your problem with multiple submission? I’ve just read this link you posted. But I don’t send a form. There are only ajax links. And when i click on another user(I have table of users and personal info displayed in CJuiDialog. I can change some fields using ajax links) and use my ajax links - it works correctly only on the first time (or after reloading page) in other cases there is a same problem with multiple submission.