Four years later, but what the hey?

Yes. I agree that the form is probably being submitted twice. If you have an 
onUnload event in your body tag which calls a Javascript function which submits 
the form, this function will run in addition to the normal submission of your 
form. To solve this, I run everything thru a closing Javascript function as 
follows:

var CountOfTimesClosed;
CountOfTimesClosed = 0;

function CloseProcedure() {
        //This function submits Form1 the first time it runs. If it runs again, 
it doesn't submit form1.
        CountOfTimesClosed = CountOfTimesClosed + 1;
        if (CountOfTimesClosed==1) {
                document.Form1.submit();
                return (false);
        }else{
                return (false);
        }
}

<!--- Body Tag: --->
<body onunload="CloseProcedure();">

<!--- Form Tag: --->
<cfform name="Form1" action="WriteUsersChangesToDB.cfm" method="post" 
onSubmit="return (false);">

<!--- Button to submit the form: --->
<input type=text name="CommitChanges" onClick="CloseProcedure();" >

<!--- Submit Tag (invisible): --->
<input type=submit style="background: white; border: 0em single white; 
color:white">

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265546
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to