Isaac wrote:
>You could do that -- you'd have to use javascript to submit 
>the form and set the value of the field after the form is 
>submitted.

Nope.  I use something very close to the code below.  The user is assigned a form ID 
on arrival.  This ID is checked for using both the persistent var you see here and 
later on when its time to hit the db and do an insert.  Kind of a double check in case 
somehow the cvar-based test doesn't work.  I know the 'UID' isn't perfect.  A UUID 
with the dashes stripped out is probably smarter.

Honestly I forget exactly.  This has just worked so well over the last couple years 
that I pretty much forgot about it.

<!---
this goes on the form page.  This is shorter than a UUID
--->
<cfset DateStamp="#NumberFormat(Now(),"_____")#">
<cfset TimeStamp=MID(Now(),16,9)>
<cfset TimeStamp=REPLACE(TimeStamp,":","","ALL")>
<cfset TimeStamp=REPLACE(TimeStamp," ","","ALL")>
<cfset OriginIP=REPLACE(CGI.REMOTE_ADDR,".","","ALL")>
<cfset FormUID="myUID" & "DateStamp & TimeStamp & OriginIP>
<input 
        type="hidden" 
        name="FormUID" 
        value="Frm#variables.FormUID#">

<!--- on the action page: --->  
<cfset VarPart1="client.">
<cfif isdefined ("#VarPart1##form.FormUID#")>
        error message goes here
        <cfabort>
<cfelse>
        <cfset "client.#form.FormUID#"=form.FormUID>
</cfif>
-------------------------------------------
 Matt Robertson,     [EMAIL PROTECTED]
 MSB Designs, Inc. http://mysecretbase.com
-------------------------------------------


---------- Original Message ----------------------------------
From: S. Isaac Dealey <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date: Tue, 10 Jun 2003 15:22:33 -0500

>You could do that -- you'd have to use javascript to submit the form and set the 
>value of the field after the form is submitted.
>
>> can always add a hidden field to the form with a specified
>> value
>> and then on the processing page add something like:
>
>> <!--- check for duplicate form submissions --->
>> <cfif #form.submissionCheck# EQ "submitted">
>> Geezo have some patients, you already submitted the form!
>> </cfif>
>
>> but then again, i know jack squat about cf
>
>
>
>
>
>> ----- Original Message -----
>> From: "Charlie Griefer" <[EMAIL PROTECTED]>
>> To: "CF-Talk" <[EMAIL PROTECTED]>
>> Sent: Tuesday, June 10, 2003 3:42 PM
>> Subject: Re: Prevent Refresh
>
>
>>> I agree with just about everything Isaac said, but wanted
>>> to chime in and
>>> say that the easiest solution would be the <cflocation>
>>> on the form's
>> action
>>> page.  This is generally how I prevent the duplicate
>>> submissions.
>>>
>>> The form's action page contains no HTML, just the insert
>>> query.  After the
>>> query successfully runs, I do a <cflocation> to a "Thank
>>> You" page.  This
>>> way, a refresh only refreshes that page.
>>>
>>>
>>>
>>> ----- Original Message -----
>>> From: "S. Isaac Dealey" <[EMAIL PROTECTED]>
>>> To: "CF-Talk" <[EMAIL PROTECTED]>
>>> Sent: Tuesday, June 10, 2003 12:34 PM
>>> Subject: Re: Prevent Refresh
>>>
>>>
>>> > > What is best way of preventing multiple entries in DB
>>> > > through form
>>> > > submission when user clicks on REFRESH or BACK button
>>> > > of
>>> > > browser?
>>> >
>>> > > Thanks
>>> > > Shaz
>>> >
>>> > I usually use cflocation to move the browser to a
>>> > confirmation template
>>> which informs the user that the record has been updated.
>>> >
>>> > In my case, this is often the form page, or in other
>>> > words, they go back
>>> to the form with a "information saved" confirmation
>>> message at the top of
>>> the form, usually with all the info they just enterred
>>> filled in on the
>> form
>>> again. I also like to use the pengoworks qForms API
>>> (www.pengoworks.com)
>> to
>>> prevent multiple form submissions in browsers that
>>> support the DOM. If I
>>> have to use cfflush on a page,
>>> >
>>> > I move from cflocation to the javascript
>>> > location.replace() which does
>> the
>>> same thing client-side by replacing the current address
>>> in the browser
>>> history. It's available in Netscape as far back as
>>> version 3 and IE
>>> similarly. I'm not certain about other browsers, although
>>> I would assume
>> at
>>> least Mozilla supports it since it was implemented in NS
>>> prior to Mozilla
>>> becoming available. There's a UDF implementation of it in
>>> the Tapestry API
>>> in my sig file also.
>>> >
>>> > hth
>>> >
>>> > s. isaac dealey                972-490-6624
>>> >
>>> > new epoch                      http://www.turnkey.to
>>> >
>>> > lead architect, tapestry cms
>>> > http://products.turnkey.to
>>> >
>>> > tapestry api is opensource
>>> > http://www.turnkey.to/tapi
>>> >
>>> > certified advanced coldfusion 5 developer
>>> > http://www.macromedia.com/v1/handlers/index.cfm?ID=2181
>>> > 6
>>> >
>>> >
>>> >
>>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ~~~~~~~~~~~|
>> Archives:
>> http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
>> Subscription: http://www.houseoffusion.com/cf_lists/index.
>> cfm?method=subscribe&forumid=4
>> FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
>
>> Your ad could be here. Monies from ads go to support these
>> lists and provide more resources for the community.
>> http://www.fusionauthority.com/ads.cfm
>
>>                              Unsubscribe: http://www.houseoffusion.com/cf_lists/uns
>>                              ubscribe.cfm?user=633.558.4
>
>
>
>
>s. isaac dealey                972-490-6624
>
>new epoch                      http://www.turnkey.to
>
>lead architect, tapestry cms   http://products.turnkey.to
>
>tapestry api is opensource     http://www.turnkey.to/tapi
>
>certified advanced coldfusion 5 developer
>http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to