Missing CFOUTPUT causes double submit
Posted by David Chandler on August 5, 2004
Recently, I came across a bizarre bug in which a page was being called twice as a result of a single click on a SUBMIT button.
The following code was the culprit:
<LINK REL=STYLESHEET TYPE=”text/css” HREF= “#variables.dir#/style.htm”>
How can a style sheet cause a double request? Well, note the absence of a CFOUTPUT. The href path begins with a pound, which is the HTML “bookmark” character that means look for a given page and scroll to a position. In the absence of a specified page (somewhere.cfm##bookmark), the browser looks for the bookmark in the current URL, so it made a GET request to the same URL it had just POSTed. Since none of the FORM values were present in the GET request, CF encountered an error, but because it was in response to a style sheet include, the error message never appeared on the page.
Make sure your HREFs with # signs are inside a CFOUTPUT block.