Doesn't work
This doesn't work. The ability to fire a submit action without the user initiating it has been deprecated for security reasons.
Posted by: Jaime Stella
Posted on: 11/12/2004 12:25 PM
|
Is there a way to tweak it to make it work?
Is there some tweak that will make this code work??
Posted by: Paul
Posted on: 11/13/2004 10:22 PM
|
It does work...
The code does work, I have used it on CF5 and CFMX. Have you tried it out? What were your results?
Posted by: Jason Rockenbach
Posted on: 11/13/2004 11:20 PM
|
Doesnt work for me either
This code doesnt seem to work for me either.
Posted by: Justin
Posted on: 02/21/2005 03:44 PM
|
More Details?
Can you provide me with more details? What exactly doesnt work for you? I use this on at least 5 different web sites and it does a great job of catching all errors.
Posted by: Jason Rockenbach
Posted on: 02/21/2005 03:56 PM
|
auto submit issue
The CF code appears to be okay, the automatic submit for the error_process.cfm page is the problem. If I replace that code and have the error_process.cfm page display with an actual submit button, things work fine. A click of the submit button will display the error.cfm page and email the contents. However, that defeats the goal of an automated process. You don't really want users to have to click a button to let you know an error occurred.
To get the auto-submit to work you may need to call it with a function that fires with the onLoad event in the <body> tag of the error_process.cfm page. This won't work all the time, but will work for errors that occur early enough to be captured by the onLoad event.
Try <script language="javascript">function autoSubmit(){ document.error_report.submit(); } </script>
Modify a <body> tag to the following: <body onLoad="autoSubmit();">
That seems to get it working as intended. Not full proof, but does most of what is expected.
Posted by: Kene
Posted on: 02/23/2005 12:38 PM
|
Tweak to make the auto submit to work
I have solved this problem in the past by adding a radio or check box to the form and use css to hide it because you don't entend for the user to click it. You can put a div around your form and had that as well.. Works for me..
Posted by: Jesse
Posted on: 08/03/2005 06:31 PM
|
enablecfoutputonly
If you get a blank error.cfm page you may want to look and see if you have enablecfoutputonly="yes" in your application.cfm page. If so set enablecfoutputonly = "no" at the top of error.cfm so that the page will display.
Posted by: Irv WIlson
Posted on: 08/18/2006 04:29 PM
|
A better method is...
...to use <cfdump>
This is what I do: <cftry> ... ... ... <cfcatch type="any"> <cfmail to="" from="" subject="" type="html"> The following errors were encountered on #dateformat(now(),"MM/DD/YYYY")# at #timeformat(now(),"HH:MM tt")# <cfdump var="#cfcatch#" label="error"> </cfmail> </cfcatch> </cftry>
The above will trap any any errors in the <cftry> clause, and e-mail them in the <cfcatch> clause. The <cfdump> is a VERY COOL tool to use to debug any issues. Provides more information then the traditional debug tool cf throws on the screen.
Posted by: Ketan
Posted on: 04/06/2007 03:27 PM
|
In the past...
I've solved this by:
1. ensuring I have html and body tags aroudn the hidden form (this affects firefox)
2. making sure the comment lines (<!-- //-->) are present in the script tag
Posted by: Michael Danque
Posted on: 01/30/2008 08:51 PM
|