Re: Is Their a Standard Way of Preventing Users from Entering Double Records by Refreshing Browser?
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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Is Their a Standard Way of Preventing Users from Entering Double Records by Refreshing Browser?
Dave, The project I am currently engaged in ran into this problem a couple of months ago. Due to the dynamic manner in which data is placed in the database (since the project has gone through several teams), JavaScript was used to catch double-clicking of submit buttons. I will say, that wh ile this method is convenient, it is not the best. I would definitely sugg est modifying the stored procedure to read before writing the data. This w ill make life a great deal easier, especially if you are in a clustered environment. Just my thought on the matter, Nick PHP php@airbridgTo: CF-Talk cf-talk@house offusion.com e.net cc: Subject: Is Their a Standa rd Way of Preventing Users from Entering 01/08/02 Double Records by Refreshing B rowser? 07:56 PM Please respond to cf-talk Is Their a Standard Way of Preventing Users from Entering Double Record s 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 Commo n Practice in your coding to follow to prevent such a small (yet potentially very common) Data Distortion. Thanks, Dave __ Why Share? Dedicated Win 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=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Is Their a Standard Way of Preventing Users from Entering Double Records by Refreshing Browser?
I've built some survey apps that set a cookie when the user submits the form. Then, if they try to submit again, it will not accept the submissi on. However, the cookies are set to die when the browser is closed, so if the user comes back in, they can submit again. You could set the cookie to l ast forever or some given amount of time if you wish. Dave - Original Message - From: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, January 09, 2002 9:39 AM Subject: Re: Is Their a Standard Way of Preventing Users from Entering Double Records by Refreshing Browser? Dave, The project I am currently engaged in ran into this problem a couple of months ago. Due to the dynamic manner in which data is placed in the database (since the project has gone through several teams), JavaScript was used to catch double-clicking of submit buttons. I will say, that wh ile this method is convenient, it is not the best. I would definitely sugg est modifying the stored procedure to read before writing the data. This w ill make life a great deal easier, especially if you are in a clustered environment. Just my thought on the matter, Nick PHP php@airbridgTo: CF-Talk cf-talk@house offusion.com e.net cc: Subject: Is Their a Standa rd Way of Preventing Users from Entering 01/08/02 Double Records by Refreshing B rowser? 07:56 PM Please respond to cf-talk Is Their a Standard Way of Preventing Users from Entering Double Record s 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 Commo n 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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Is Their a Standard Way of Preventing Users from Entering Double Records by Refreshing Browser?
Just another thing to add, I used to generally used the cflocation approach to redirect the user to a confirmation page. However after comparing this with the other option (checking if the record exists in the database) I realised there is a noticeable delay with using the cflocation approach while the page cflocates to the next page. KOla Kola Oyedeji |Web Developer |ekeda elthorne gate |64 high street |pinner |middx |ha55qa t +44(208)429 7333 f +44(208)429 7339 |www.ekeda.co.uk -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 09 January 2002 14:40 To: CF-Talk Subject: Re: Is Their a Standard Way of Preventing Users from Entering Double Records by Refreshing Browser? Dave, The project I am currently engaged in ran into this problem a couple of months ago. Due to the dynamic manner in which data is placed in the database (since the project has gone through several teams), JavaScript was used to catch double-clicking of submit buttons. I will say, that wh ile this method is convenient, it is not the best. I would definitely sugg est modifying the stored procedure to read before writing the data. This w ill make life a great deal easier, especially if you are in a clustered environment. Just my thought on the matter, Nick PHP php@airbridgTo: CF-Talk cf-talk@house offusion.com e.net cc: Subject: Is Their a Standa rd Way of Preventing Users from Entering 01/08/02 Double Records by Refreshing B rowser? 07:56 PM Please respond to cf-talk Is Their a Standard Way of Preventing Users from Entering Double Record s 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 Commo n Practice in your coding to follow to prevent such a small (yet potentially very common) Data Distortion. Thanks, Dave __ Why Share? Dedicated Win 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=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Is Their a Standard Way of Preventing Users from Entering Double Records by Refreshing Browser?
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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Is Their a Standard Way of Preventing Users from Entering Double Records by Refreshing Browser?
about a year ago, I wrote this article (joseph thompson did the write up) w hich covers some ideas to disable back buttons. http://cfhub.com/contributions/backbutton/ with the code you can also catch double clicks, Mahmut Basaran Measure twice Cut once -- Original Message -- from: PHP [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] date: Tue, 08 Jan 2002 19:56:33 -0500 Is Their a Standard Way of Preventing Users from Entering Double Records b y Refreshing Browser? So when I submit A name and Email to a database and then hit refresh on th e page I was sent to Another entry appears in the Database with the same information duplicated. Is their a Common P ractice in your coding to follow to prevent such a small (yet potentially very common) Data Distortion. Thanks, Dave __ Get Your Own 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=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Is Their a Standard Way of Preventing Users from Entering Double Records by Refreshing Browser?
Standard database procedures in all cases unless you are 100% certain that the record cannot exists is to read before write..check the database to see if the record exists before inserting it. If it does, and you're on a page that only does inserts, you can throw away the second instance or update the existing record. At 07:56 PM 1/8/02, Dave wrote: Is Their a Standard Way of Preventing Users from Entering Double Records by Refreshing Browser? __ Why Share? Dedicated Win 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=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists