Try something like this (not real code, just a logic path):
* If this is the initial time to the form, query for current data in the
database and prepopulate form.
* Allow user to make changes; form submits to itself.
* a SQL UPDATE statement would happen on the template before the new data
for the form is queried for...
* ...after this is processed, query for data, and form will be populated
with new data
So,
<cfif isDefined("FORM.submit")>
<cfquery>UPDATE</cfquery>
<cfset msg="updated">
</cfif>
<cfquery>SELECT data</cfquery>
<cfif isDefined("msg") and msg IS "updated">Data has been updated</cfif>
<form action="#CGI.script_name#">
Form
goes
here
</form>
Or something like that...
Pete
----- Original Message -----
From: "Robert Orlini" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, April 25, 2002 9:25 AM
Subject: history from update
> Hello,
>
> I have a display page that includes certain fields that are updated. When
the user clicks the "UPDATE" it goes to an update.cfm page. I've included a
"BACK to Query Results page" button with a onClick="history.go(-1)" script
in the update.cfm page to go back after the update has been made.
>
> What I would like is after the user clicks "UPDATE" and the field(s) are
updated by the update.cfm page it would automatically return them to the
original page with the "updated" fields w/o clicking any "BACK to Query
Results page" button.
>
> Any ideas or suggestions? I'm thinking <CFLocation> but I don't think it
is good.
>
> Thanks. (code for update.cfm below)
>
> Robert O.
>
>
>
> <cfquery name="update" datasource="wweb">
> UPDATE wweb SET Status = '#form.statuslist#', Activatedby =
'#Form.activatedby#'
> Where ID = #form.ID#
> </cfquery>
>
> <b><font face="Arial" size="3">Record has been updated.</font></b>
> <p>
> <font face="Arial" size="2"><b>
> <input type="button" value="BACK to Query Results page"
onClick="history.go(-1)"></b></font>
>
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
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