12th October 2011 Update: Looks like I was correct in assuming it would affect other browsers as I now see reports of this happening in other browsers like safari, and firefox.
7th May 2011 Update: I think I found the point at which bug was introduced, and it’s related to HTML5. See http://www.html-5.com/tags/button-tag/index.html for details. Original post is below, but if I’ve understood the issue, I wonder if that means it’ll affect newer browsers when they update, if this is a part of the html5 standards?
I saw some code recently that looked like a little like this (greatly cut down version that highlights the key points):
[code lang=”html”]
Testing formAction in Chrome
[/code] The idea was that if the user clicked "DELETE" it would prompt the user to confirm their action. This worked in IE and Firefox, but my browser of choice is Chrome, and for some reason the page wouldn't do anything upon submitting. I eventually tracked it down to the javascript variable being used, formAction. When you set formAction in the onclick, it actually set's the form's action attribute value. So what was essentially happening when I clicked Add was that the form action would be set to empty, and so would post to itself, minus the querystring part, action=add. By changing the variable to form_action, it solved the issue. I also proved this by writing a quick test page: [code lang="html"] Testing formAction in Chrome
[/code]
I've not seen any mention of this behaviour on any other site, so thought I would post it just in case someone else runs into this similar gotcha.
One thought to “Interesting form actions “bug”/”behaviour” in Google Chrome”
.