Because I have multiple forms in one page and would like my application to be cool Also submitting some of the forms takes a while so i would like to use the loading class to indicate that the website is thinking…that kind of stuff
When the above code is placed directly in the view file all works fine. When however placed in the view file via renderPartial it always submits the form twice. If I have two such forms through renderPartial it submits 4 times no matter that only one form is submitted. I’ve made sure all ajaxSubmitButtons have unique names and the forms have unique names.
Interesting. I assigned a unique parameter to each renderPartial. All came down to the conclusion that each renderPartial submit itself twice. Not sure why. Did another test by declaring the renderPartial like this:
I don’t know why you started to use the fourth parameter of renderPartial set to true (IIRC in another thread you were advised to use it).
With the jQuery.live() call used in recent versions of CHtml I guess a lot of event rearming kind of problems went away. But I can’t imagine every possible case.
With the fourth parameter set to true, one problem is that jQuery may be included more than once
See this thread.
A worse problem (that’s probably what hit you) is that multiple jQuery stubs would be generated in the document.ready script section.
I don’t know the exact reason why some people (some configurations) run into problems. Like others suggested, perhaps a hardware and browser dependent DOM update race condition. Possibly it might be a good idea to modify CHtml to set of a delay before modifying jQuery stubs. I’m just guessing here, didn’t investigate.
Hi, I know this is a very old thread, but I’m having a similar issue where it’s doing two submits. The problem, though, is that if I change the fourth parameter of renderPartial() to false, then my time-pickers and sliders (which are dynamically loaded) don’t display on the form.