[LRUG] Double submit

Andrew Stewart boss at airbladesoftware.com
Fri Jan 17 04:42:26 PST 2014


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.




More information about the Chat mailing list