one solution is to use a 3-page approach.

form page -> update page -> thank you page

the form page is self-explanatory.  contains your form.
the update page has your updat query in it.  once the query succeeds,
do a <cflocation> to...

the thank you page.  this is the page that lets your user know the
update completed successfully.  and since it contains no UPDATE query
itself, it can be refreshed over and over and over with no adverse
effects on your data :)


On Wed, 22 Sep 2004 14:04:36 -0400, Daniel Kessler <[EMAIL PROTECTED]> wrote:
> I posted this on cf-newbies, but didn't understand the answer, nor
> could I get another solution to work.
>
> I have a form that goes to a page which updates a database.  I check
> to see if the form exists and that an answer exists so that the
> database will be updated.  Unfortunately, when I refresh the page, it
> re-submits the form content.  I tried setting up a no-cache pragma
> <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
> <META HTTP-EQUIV="Expires" CONTENT="-1">
>
> as well as:
> document.forms[0].reset();  which only applies to the form elements,
> it seems.  I can set form elements through CF, but they're set back
> to their original values on refresh.
>
> I tried this, which I saw on a CF site:
> <CFSET gmt = gettimezoneinfo()>
> <CFSET gmt = gmt.utcHourOffset>
> <CFIF gmt EQ 0>
> <CFSET gmt = "">
> <CFELSEIF gmt GT 0>
> <CFSET gmt = "+" & gmt >
> </CFIF>
> <CFHEADER NAME="Pragma" VALUE="no-cache">
> <CFHEADER NAME="Cache-Control" VALUE="no-cache, must-revalidate">
> <CFHEADER NAME="Last-Modified" VALUE="#DateFormat(now(), 'ddd, dd mmm
> yyyy')# #TimeFormat(now(), 'HH:mm:ss')#GMT#gmt#">
> <CFHEADER NAME="Expires" VALUE="Mon, 26 Jul 1997 05:00:00GMT">
>
> <cfflush> didn't work, though it seems to apply from the manual.
>
> I've tried alot of things, for hours.  Still, when I refresh the
> page, it resubmits the content.  Anyone know a cure for this, either
> through CF or not?
>
> --
> Daniel Kessler
>
> Department of Public and Community Health
> University of Maryland
> Suite 2387 Valley Drive
> College Park, MD  20742-2611
> 301-405-2545 Phone
> www.phi.umd.edu
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to