RE: Prevent Refresh
What I do is the following: 1) Set a session variable on the page that will submit the form, usually called session.frm_submit, and set it to 1. 2) Create a CFIF on the page the form submits to that checks the value of the session variable, and, if it is 1, sets it to 0 then processes the submission. If the value is already 0, the submission is ignored. This means the user would have to go back to the form page and reload it completely in order to submit the form twice. M -Original Message- From: Shahzad.Butt [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 9:18 AM To: CF-Talk Subject: 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 ~| 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/unsubscribe.cfm?user=89.70.4
RE: Prevent Refresh
To avoid the refresh problem the best way to handle idempotent actions i.e form submissions is to perform a redirection after the relevant action has occurred. Note: This requires a client-side redirect which will do for you. So the page flow becomes this: 1) Form 2) "Action Page" - Database insert/update etc. 3) Redirect 4) End Page/Confirmation/Form again... If a refresh is done once on step 4, the Action page will not be run again. Hope that helps, André -Original Message- From: Shahzad.Butt [mailto:[EMAIL PROTECTED] Sent: 10 June 2003 14:18 To: CF-Talk Subject: 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 ~| 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
Re: Prevent Refresh
oi Shahzad.Butt!! on the preceding page... window.history.forward(); this will prevent use of the back button... on your form page.. for the refresh problem you can do this... if not isDefined("request.pageHit") ... do page stuff. set request.pageHit = true page has already been accessed Crit Tuesday, June 10, 2003, 9:18:17 AM, you wrote: SB> What is best way of preventing multiple entries in DB through form SB> submission when user clicks on REFRESH or BACK button of browser? SB> Thanks SB> Shaz SB> ~| 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/unsubscribe.cfm?user=89.70.4
Re: Prevent Refresh
Something else you can do is disable the submit button onClick I think thats the right value to assign to disabled. Stephen - Original Message - From: "Shahzad.Butt" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, June 10, 2003 2:18 PM Subject: 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 > > ~| 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/unsubscribe.cfm?user=89.70.4
Re: Prevent Refresh
oi Critz!! whoops.. request scope won't work doh! session will.. Tuesday, June 10, 2003, 9:32:55 AM, you wrote: C> oi Shahzad.Butt!! C> on the preceding page... C> C> window.history.forward(); C> C> this will prevent use of the back button... C> on your form page.. for the refresh problem you can do this... C> if not isDefined("request.pageHit") C> ... do page stuff. C> set request.pageHit = true C> C> page has already been accessed C> C> Crit C> C> Tuesday, June 10, 2003, 9:18:17 AM, you wrote: SB>> What is best way of preventing multiple entries in DB through form SB>> submission when user clicks on REFRESH or BACK button of browser? SB>> Thanks SB>> Shaz SB>> C> ~| 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
RE: Prevent Refresh
I cant use session scope in my app because of load balancing and stuff. So need a work around using request scope. Any suggetions??? Shaz -Original Message- From: Critz [mailto:[EMAIL PROTECTED] Sent: 10 June 2003 14:48 To: CF-Talk Subject: Re: Prevent Refresh oi Critz!! whoops.. request scope won't work doh! session will.. Tuesday, June 10, 2003, 9:32:55 AM, you wrote: C> oi Shahzad.Butt!! C> on the preceding page... C> C> window.history.forward(); C> C> this will prevent use of the back button... C> on your form page.. for the refresh problem you can do this... C> if not isDefined("request.pageHit") C> ... do page stuff. C> set request.pageHit = true C> C> page has already been accessed C> C> Crit C> C> Tuesday, June 10, 2003, 9:18:17 AM, you wrote: SB>> What is best way of preventing multiple entries in DB through form SB>> submission when user clicks on REFRESH or BACK button of browser? SB>> Thanks SB>> Shaz SB>> C> ~| 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 Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Prevent Refresh
oi Shahzad.Butt!! client. ? Crit Tuesday, June 10, 2003, 9:52:46 AM, you wrote: SB> I cant use session scope in my app because of load balancing and stuff. SB> So need a work around using request scope. Any suggetions??? SB> Shaz SB> -Original Message- SB> From: Critz [mailto:[EMAIL PROTECTED] SB> Sent: 10 June 2003 14:48 SB> To: CF-Talk SB> Subject: Re: Prevent Refresh SB> oi Critz!! SB> whoops.. request scope won't work doh! session will.. SB> SB> Tuesday, June 10, 2003, 9:32:55 AM, you wrote: C>> oi Shahzad.Butt!! C>> on the preceding page... C>> C>> window.history.forward(); C>> C>> this will prevent use of the back button... C>> on your form page.. for the refresh problem you can do this... C>> if not isDefined("request.pageHit") C>> ... do page stuff. C>> set request.pageHit = true C>> C>> page has already been accessed C>> C>> Crit C>> C>> Tuesday, June 10, 2003, 9:18:17 AM, you wrote: SB>>> What is best way of preventing multiple entries in DB through form SB>>> submission when user clicks on REFRESH or BACK button of browser? SB>>> Thanks SB>>> Shaz SB>>> C>> SB> ~| 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 Host with the leader in ColdFusion hosting. Voted #1 ColdFusion host by CF Developers. Offering shared and dedicated hosting options. www.cfxhosting.com/default.cfm?redirect=10481 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
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 dealey972-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
Re: Prevent Refresh
Aren't there issues with disabled in some fairly common versions of NS and Mozilla? > Something else you can do is disable the submit button > onClick > onClick="this.disabled=true;"> > I think thats the right value to assign to disabled. > Stephen > - Original Message - > From: "Shahzad.Butt" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Tuesday, June 10, 2003 2:18 PM > Subject: 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 >> >> > ~~ > ~~~| > 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 dealey972-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
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 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 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 dealey972-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 Host with the leader in ColdFusion hosting. Voted #1 ColdFusion host by CF Developers. Offering shared and dedicated hosting options. www.cfxhosting.com/default.cfm?redirect=10481 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Prevent Refresh
Thanks for clarifying that Charlie. :) I just realized my explanation was a little fuzzy. > I agree with just about everything Isaac said, but wanted > to chime in and > say that the easiest solution would be the 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 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 dealey972-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 > Host with the leader in ColdFusion hosting. > Voted #1 ColdFusion host by CF Developers. > Offering shared and dedicated hosting options. > www.cfxhosting.com/default.cfm?redirect=10481 > Unsubscribe: http://www.houseoffusion.com/cf_lists/uns > ubscribe.cfm?user=633.558.4 s. isaac dealey972-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 Host with the leader in ColdFusion hosting. Voted #1 ColdFusion host by CF Developers. Offering shared and dedicated hosting options. www.cfxhosting.com/default.cfm?redirect=10481 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Prevent Refresh
I assign a UUID to the form in both a persistent var (session or client) and a hidden form var (as a backup). Then test for that in the db upon an insert attempt. Any user who hits refresh gets a nice note saying "I don't THINK so". The same mechanism and a cfif or two also prevents a user from hitting their BACK button and submitting the same form again thataway. --- Matt Robertson, [EMAIL PROTECTED] MSB Designs, Inc. http://mysecretbase.com --- -- Original Message -- From: "Charlie Griefer" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] Date: Tue, 10 Jun 2003 12:42:09 -0700 >I agree with just about everything Isaac said, but wanted to chime in and >say that the easiest solution would be the 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 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 dealey972-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 Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Prevent Refresh
can always add a hidden field to the form with a specified value and then on the processing page add something like: Geezo have some patients, you already submitted the form! 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 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 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 dealey972-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 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/unsubscribe.cfm?user=89.70.4
Re: Prevent Refresh
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: > > > Geezo have some patients, you already submitted the form! > > 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 >> 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 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 dealey972-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 dealey972-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 This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Prevent Refresh
wouldn't that fire every time the form was submitted? and if refresh was pressed on the form's action page...how would it prevent the data from re-posting? - Original Message - From: "Dave Lyons" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, June 10, 2003 1:04 PM Subject: Re: Prevent Refresh > can always add a hidden field to the form with a specified value > and then on the processing page add something like: > > > > Geezo have some patients, you already submitted the form! > > > 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 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 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 dealey972-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 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/unsubscribe.cfm?user=89.70.4
Re: Prevent Refresh
yeah, I thought about that afterwards. somewhere I have done it and I don't remember what I did. I think I had set a session and used that as the default value for the hidden field and added +1. So if it was more that 1 it gave the error message. I told u I don't know crap, lol - Original Message - From: "Charlie Griefer" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, June 10, 2003 4:24 PM Subject: Re: Prevent Refresh > wouldn't that fire every time the form was submitted? > > and if refresh was pressed on the form's action page...how would it prevent > the data from re-posting? > > - Original Message - > From: "Dave Lyons" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Tuesday, June 10, 2003 1:04 PM > Subject: Re: Prevent Refresh > > > > can always add a hidden field to the form with a specified value > > and then on the processing page add something like: > > > > > > > > Geezo have some patients, you already submitted the form! > > > > > > 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 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 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 dealey972-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 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/unsubscribe.cfm?user=89.70.4
Re: Prevent Refresh
> wouldn't that fire every time the form was submitted? Right, it would... I think my interpretation of what you were saying goes something like this: form.submit --> action page, begin processing meanwhile, the user is still looking at the form since they don't get the action page results until the action page finishes processing, so they hit submit again form.submit --> action page -- ask user to be patient now... if you just use a regular hidden form field, it's going to see that every time the form is submitted, so the user won't ever get anything other than the request for patience, so you have to change the value in the form between the first and 2nd submission, hence the javascript > and if refresh was pressed on the form's action page... > how would it prevent the data from re-posting? Well this by itself doesn't solve the issue of duplicated entries in the database, it merely prevents the form from initiating the action page twice. It also doesn't prevent the user from refreshing the form page, filling in the form again and resubmitting the form that way... none of this being really a complete solution for anything, just conjecture. :) I still think cflocation on the action page is the better part of the best solution for the issue as a whole. I think Charlie Griefer gave probably the clearest explanation of that solution. > - Original Message - > From: "Dave Lyons" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Tuesday, June 10, 2003 1:04 PM > Subject: Re: Prevent Refresh >> can always add a hidden field to the form with a >> specified value >> and then on the processing page add something like: >> >> >> >> Geezo have some patients, you already submitted the form! >> >> >> 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 >> > 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 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 >> > b
Re: Prevent Refresh
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. error message goes here --- 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: > >> >> >> Geezo have some patients, you already submitted the form! >> > >> 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 >>> 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 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 dealey972-490-6624 >>> > >>> > new epoch http://www.turnkey.to >>> > >>> > lead architect, tapestry cms >>> > http://products.turnkey.to >>> > >>> > tapestry api is opensource >>> > http://www.t
Re: Prevent Refresh
> 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. Well, I was commenting on having passed a variable from a form and simply determining whether to perform the action or display the message on the basis of just that one form field, without any other context such as the db, etc. > Honestly I forget exactly. This has just worked so > well over the last couple years that I pretty much > forgot about it. Gotta love fire-and-forget solutions. :) s. isaac dealey972-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
Re: Prevent Refresh
>Well, I was commenting on having passed a variable from a form >and simply determining whether to perform the action or >display the message on the basis of just that one form field, >without any other context such as the db, etc. ah... I missed that boat. >Gotta love fire-and-forget solutions. :) Yup. One thing it does, though, is leave cvars littered in the cvar db, which is a minor annoyance to me when I see a regular user with 10 vars in there... although it affects very little and of course they get flushed out eventually. I'm writing a thing now to expire old ones prior to assigning a new one since I keep date stamp data in there. Good thing I have nothing important to do than tinker with running code :D --- 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 16:02:50 -0500 >> 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. > >Gotta love fire-and-forget solutions. :) > >s. isaac dealey972-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
RE: Prevent Refresh
Great job! That works fine. Thanks -Original Message- From: Matt Robertson [mailto:[EMAIL PROTECTED] Sent: 10 June 2003 22:00 To: CF-Talk Subject: Re: Prevent Refresh 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. error message goes here --- 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: > >> >> >> Geezo have some patients, you already submitted the form! > >> 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 >>> 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 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 dealey972-490-6624 >>> > >>> > new epoch http://www.turnkey.to >>> > >>> > lead architect, tapestry cms >>> > http://products.turnkey.to >>> &g
RE: Prevent Refresh
Try cflocation after all code has executed... Taco Fleur Blog http://www.tacofleur.com/index/blog/ Methodology http://www.tacofleur.com/index/methodology/ Tell me and I will forget Show me and I will remember Teach me and I will learn -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 5:31 AM To: CF-Talk Subject: OT: Prevent Refresh Is there any way to disable the Refresh button or option or prevent a user from refreshing a page? It's causing some problems with our CF coding and sending out multiple emails. Is there a way in _javascript_ or CF? Robert O. HWW _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Prevent Refresh
You could wrap your code around a CFIF statement that checks to see if the cgi.http_referer does not equal "" or the current page. Then it would run the refresh but not the email code. -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 1:31 PM To: CF-Talk Subject: OT: Prevent Refresh Is there any way to disable the Refresh button or option or prevent a user from refreshing a page? It's causing some problems with our CF coding and sending out multiple emails. Is there a way in _javascript_ or CF? Robert O. HWW _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Prevent Refresh
I think you need to take a 2 part strategy 1) set up some onClick so the form button disables itself upon submission. That way it does not allow a resubmission. 2) set up the post-form-processing page so that it redirects (CFLOCATION) the user to confirmation page which they can refresh all they like Clicking back, will never get the interim form-submitted page, so you should be safe. -Dov _ From: Ryan Kime [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 3:33 PM To: CF-Talk Subject: RE: Prevent Refresh You could wrap your code around a CFIF statement that checks to see if the cgi.http_referer does not equal "" or the current page. Then it would run the refresh but not the email code. -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 1:31 PM To: CF-Talk Subject: OT: Prevent Refresh Is there any way to disable the Refresh button or option or prevent a user from refreshing a page? It's causing some problems with our CF coding and sending out multiple emails. Is there a way in _javascript_ or CF? Robert O. HWW _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Prevent Refresh
1) I think you mean hide the button, as soon as you disable the submit button it will not submit the form, even if you just clicked it. Taco Fleur Blog http://www.tacofleur.com/index/blog/ Methodology http://www.tacofleur.com/index/methodology/ Tell me and I will forget Show me and I will remember Teach me and I will learn -Original Message- From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 6:43 AM To: CF-Talk Subject: RE: Prevent Refresh I think you need to take a 2 part strategy 1) set up some onClick so the form button disables itself upon submission. That way it does not allow a resubmission. 2) set up the post-form-processing page so that it redirects (CFLOCATION) the user to confirmation page which they can refresh all they like Clicking back, will never get the interim form-submitted page, so you should be safe. -Dov _ From: Ryan Kime [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 3:33 PM To: CF-Talk Subject: RE: Prevent Refresh You could wrap your code around a CFIF statement that checks to see if the cgi.http_referer does not equal "" or the current page. Then it would run the refresh but not the email code. -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 1:31 PM To: CF-Talk Subject: OT: Prevent Refresh Is there any way to disable the Refresh button or option or prevent a user from refreshing a page? It's causing some problems with our CF coding and sending out multiple emails. Is there a way in _javascript_ or CF? Robert O. HWW _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Prevent Refresh
> This will still submit the form. -nathan strutz -Original Message- From: Taco Fleur [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 2:13 PM To: CF-Talk Subject: RE: Prevent Refresh 1) I think you mean hide the button, as soon as you disable the submit button it will not submit the form, even if you just clicked it. Taco Fleur Blog http://www.tacofleur.com/index/blog/ Methodology http://www.tacofleur.com/index/methodology/ Tell me and I will forget Show me and I will remember Teach me and I will learn -Original Message- From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 6:43 AM To: CF-Talk Subject: RE: Prevent Refresh I think you need to take a 2 part strategy 1) set up some onClick so the form button disables itself upon submission. That way it does not allow a resubmission. 2) set up the post-form-processing page so that it redirects (CFLOCATION) the user to confirmation page which they can refresh all they like Clicking back, will never get the interim form-submitted page, so you should be safe. -Dov _ From: Ryan Kime [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 3:33 PM To: CF-Talk Subject: RE: Prevent Refresh You could wrap your code around a CFIF statement that checks to see if the cgi.http_referer does not equal "" or the current page. Then it would run the refresh but not the email code. -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 1:31 PM To: CF-Talk Subject: OT: Prevent Refresh Is there any way to disable the Refresh button or option or prevent a user from refreshing a page? It's causing some problems with our CF coding and sending out multiple emails. Is there a way in _javascript_ or CF? Robert O. HWW _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Prevent Refresh
Do whatever you want... ... disabled works in IE using some css attribute... show a layer on top of the button... hide the button etc... But obviously any way that results in the inability to click it was the point I was making... _ From: Taco Fleur [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 4:13 PM To: CF-Talk Subject: RE: Prevent Refresh 1) I think you mean hide the button, as soon as you disable the submit button it will not submit the form, even if you just clicked it. Taco Fleur Blog http://www.tacofleur.com/index/blog/ Methodology http://www.tacofleur.com/index/methodology/ Tell me and I will forget Show me and I will remember Teach me and I will learn -Original Message- From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 6:43 AM To: CF-Talk Subject: RE: Prevent Refresh I think you need to take a 2 part strategy 1) set up some onClick so the form button disables itself upon submission. That way it does not allow a resubmission. 2) set up the post-form-processing page so that it redirects (CFLOCATION) the user to confirmation page which they can refresh all they like Clicking back, will never get the interim form-submitted page, so you should be safe. -Dov _ From: Ryan Kime [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 3:33 PM To: CF-Talk Subject: RE: Prevent Refresh You could wrap your code around a CFIF statement that checks to see if the cgi.http_referer does not equal "" or the current page. Then it would run the refresh but not the email code. -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 1:31 PM To: CF-Talk Subject: OT: Prevent Refresh Is there any way to disable the Refresh button or option or prevent a user from refreshing a page? It's causing some problems with our CF coding and sending out multiple emails. Is there a way in _javascript_ or CF? Robert O. HWW _ _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Prevent Refresh
On a button it works, but not a type="submit" What if _javascript_ is turned off? I would only use a type="button" in a controlled environment, not on the internet, but that's just how I work, take it or leave it. Taco Fleur Blog http://www.tacofleur.com/index/blog/ Methodology http://www.tacofleur.com/index/methodology/ Tell me and I will forget Show me and I will remember Teach me and I will learn -Original Message- From: Nathan Strutz [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 7:20 AM To: CF-Talk Subject: RE: Prevent Refresh > This will still submit the form. -nathan strutz -Original Message- From: Taco Fleur [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 2:13 PM To: CF-Talk Subject: RE: Prevent Refresh 1) I think you mean hide the button, as soon as you disable the submit button it will not submit the form, even if you just clicked it. Taco Fleur Blog http://www.tacofleur.com/index/blog/ Methodology http://www.tacofleur.com/index/methodology/ Tell me and I will forget Show me and I will remember Teach me and I will learn -Original Message- From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 6:43 AM To: CF-Talk Subject: RE: Prevent Refresh I think you need to take a 2 part strategy 1) set up some onClick so the form button disables itself upon submission. That way it does not allow a resubmission. 2) set up the post-form-processing page so that it redirects (CFLOCATION) the user to confirmation page which they can refresh all they like Clicking back, will never get the interim form-submitted page, so you should be safe. -Dov _ From: Ryan Kime [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 3:33 PM To: CF-Talk Subject: RE: Prevent Refresh You could wrap your code around a CFIF statement that checks to see if the cgi.http_referer does not equal "" or the current page. Then it would run the refresh but not the email code. -Original Message- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 1:31 PM To: CF-Talk Subject: OT: Prevent Refresh Is there any way to disable the Refresh button or option or prevent a user from refreshing a page? It's causing some problems with our CF coding and sending out multiple emails. Is there a way in _javascript_ or CF? Robert O. HWW _ _ _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Prevent Refresh
No, just a simple disable or name change on the onClick, then you just have to make sure that the form does not submit without the button having the appropriate name. Something like this for instance: == 'Process') this.form.submit(); this.value = 'Please Wait.';"> When you click the button it changes its name to Please Wait. Then submits the form. If the user keeps clicking the button, the form will not be submitted again. hth, larry Taco Fleur wrote: > 1) I think you mean hide the button, as soon as you disable the submit > button it will not submit the form, even if you just clicked it. > > > Taco Fleur > Blog > http://www.tacofleur.com/index/blog/ > Methodology http://www.tacofleur.com/index/methodology/ > > Tell me and I will forget > Show me and I will remember > Teach me and I will learn > > -Original Message- > From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED] > Sent: Thursday, 12 February 2004 6:43 AM > To: CF-Talk > Subject: RE: Prevent Refresh > > > I think you need to take a 2 part strategy > > > 1) set up some onClick so the form button disables itself upon > submission. That way it does not allow a resubmission. > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: prevent refresh w/session
Your code should read as follows: and dont forget to lock your session scope.. Paul [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: prevent refresh w/session
session.ranAlready)> Run Code This will mean the code will only be ran once per session *not* refresh is that what you are trying to achieve? Probs want to lock it as well -- dc [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: prevent refresh w/session
need to reverse you Boolean logic Do Stuff Don't do stuff Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: prevent refresh w/session
Yes. Except when I use the "not" after the CFIF it doesn't display the page at all. When I leave the "not" in it displays it, but when I refresh it adds data to the page and that's what I'm trying to avoid. Am I still missing something? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 04, 2004 10:16 AM To: CF-Talk Subject: RE: prevent refresh w/session session.ranAlready)> Run Code This will mean the code will only be ran once per session *not* refresh is that what you are trying to achieve? Probs want to lock it as well -- dc _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: prevent refresh w/session
> Yes. Except when I use the "not" after the CFIF it doesn't > display the page at all. When I leave the "not" in it > displays it, but when I refresh it adds data to the page and > that's what I'm trying to avoid. Am I still missing something? I would recommend using cfparam then check for a value not for existence. Do something... Do something else... [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]