[LRUG] Double submit

Gareth Visagie gareth.visagie at gmail.com
Fri Jan 17 04:51:31 PST 2014


Double submit like that can be caused by jquery_ujs getting pulled into the page twice. Might be worth checking?

Gareth

----------------------------
Sent from my phone

> On 17 Jan 2014, at 12:42, Andrew Stewart <boss at airbladesoftware.com> wrote:
> 
>> On 17 Jan 2014, at 13:22, Alexander Hockey-Sweeney <alexsween at gmail.com> wrote:
>> The submit handler has been bound twice
> 
> Is there any way to inspect what events are bound and/or fired when the form is submitted?
> 
>> - So potentially a double include of the javascript file
> 
> Looking at what's loaded in production via Chrome's Network tab, I only see my "all.js" once.
> 
>> - extra javascript that handles a submit or click, potentially meant for another part of the application
> 
> If this were the case, wouldn't the double-submit always happen rather than intermittently (once a week or so)?
> 
>> Clicking versus hitting enter
>> - event binding for click vs. hitting enter might be different (you'll get double in one instance, but not the other)
> 
> I'll look into this...
> 
>> Format of request
>> - Are both requests js or is one js and one html? Likely indicator that there is a double binding
> 
> Both are HTML according to the Rails log.
> 
>> Redirects
>> - do you have any redirects set-up in your application? Sometimes respond_with automatically redirects unexpectedly (depending on the format of the request)
> 
> No, the application just renders an HTML partial.
> 
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org



More information about the Chat mailing list