This is what I do, and it seems to work quite well. My standard procedure
for forms is roughly as follows and it is the most efficient way I have
found to do forms:
<cfcase value="RegistrationStep2">
<cfif attributes.Submitted>
<cfinclude template="act_ValidateStep2.cfm"><!--- This file puts
any error messages in l_Error --->
<cfif l_Error EQ "">
<cfinclude template="act_ProcessStep2.cfm"><!--- Includes a
redirect --->
</cfif>
<cfelse>
<cfinclude template="act_DefaultStep2.cfm">
</cfif>
<cfinclude template="../../Blocks/dsp_Message.cfm">
<cfinclude template="dsp_RegistrationForm2.cfm">
</cfcase>
The dsp_Message.cfm file displays any error message. I use the cf_FormURL2
Attributes to set vars to attributes scope and then use value="#attribute
s.name#" for all form inputs, and in act_Default.cfm I set default values
for those attributes scoped variables.
-Ben Morris
>>> Bryan Stevenson <[EMAIL PROTECTED]> 01/08/02 07:59PM >>>
yup...use CFLOCATION to send the user to a confirmation page after a
successful INSERT. Then if
they refresh that page al they are doing is re-displaying the confirmation
message and not
re-running the INSERT query.
Bryan Stevenson
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
p. 250.920.8830
e. [EMAIL PROTECTED]
---------------------------------------------------------
Macromedia Associate Partner
www.macromedia.com
----- Original Message -----
From: "PHP" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, January 08, 2002 4:56 PM
Subject: Is Their a Standard Way of Preventing Users from Entering Double
Records by Refreshing
Browser?
> Is Their a Standard Way of Preventing Users from Entering Double Records
by Refreshing Browser?
>
> So when I submit A name and Email to a database and then hit refresh on
the page I was sent to
Another entry appears
>
> in the Database with the same information duplicated. Is their a Common
Practice in your coding
to follow to prevent such a
>
> small (yet potentially very common) Data Distortion.
>
>
>
> Thanks,
>
> Dave
>
>
>
______________________________________________________________________
Dedicated Windows 2000 Server
PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists