Hi,
I would recommend against session variables. That has caused
a lot of problems for me in the past. Especially if users have
multiple browser windows open, because you have transfer of the
data from one window to the other.
There's two things I would recommend:
Do not use the standard edit-page / action page structure.
Instead use a form, that posts all data to itself by default
and all edit field should be setup to take the form values to
pre-populate the form.
Then at the beginning of that script verify if the "save"
button was clicked, and in that case save the data to the database,
and leave the form to the next screen using cflocation.
I have copied some lines as an example.
But it's probably is too late to change your existing
application
cheers,
fober
<cfif isdefined('btn_save')>
<cfinclude ...some script to save the data
</cfif>
<cfoutput>
<form method="post">
#imform_edit('fname','First name')#
#imform_edit('lname','Last name')#
#imform_edit('company','Company')#
#imform_button('btn_save','Save')#
</form>
</cfoutput>
<cffunction name="imform_edit" output="Yes">
<cfargument name="name" type="string" default="">
<cfargument name="title" type="string" default="">
<cfargument name="required" type="string"
default="false">
<cfargument name="style" type="string" default="">
<cfargument name="format" type="string" default="">
<cfargument name="readonly" type="string"
default="false">
<cfparam name="temp_value" default="">
<cfparam name="form.#name#" default="">
<cfset temp_value= form[name]>
<label for="#name#">#title#<cfif required is
true>*</cfif></label>
<input type="Text" name="#name#" id="#name#"
value="#temp_value#"
<cfif isdefined('btn_save') and temp_value is
"">style="border:1px solid red"</cfif>><br>
</cffunction>
<cffunction name="imform_button" output="Yes">
<cfargument name="name" type="string" default="">
<cfargument name="title" type="string" default="">
<input type="Submit" name="#name#"
value="#title#"><br>
</cffunction>