If your queries are cached, it's not going to make difference so make sure
that's not the case.

I do all of this in one template with smaller single step forms.

1) Check to see if the form was submitted. If so, validate any fields and
update the record then redirect right back the same page so the request
method is no longer 'post' and the user is looking at the latest data.

2) get the data you want from the database

3) build your form that submits right back to itself.


<!---// 
I normally just check the request method. If more than one form can 
submit to this page, you'll want to check for a field or button name
in the form you want to process 
//--->


<cfsilent>

<cfif http.request_method is "post">

        <!---// 
        form was submitted. Validate the required fields, update the 
        data, and cflocate back to this page. 
        //--->
        
        <cfif len(trim(form.myRequiredFormField)) is 0>
                <!---// 
                if any fields don’t check out, do something here like set 
                a message  
                //--->
        <cfelse>
                <!---// Fields checked out, update the record //--->
                <cfquery ...>
                Update ....
              </cfquery>
        
                <!---// 
                redirect back to this page to change the request method 
                //--->
                <cflocation url="thispage.cfm" addtoken="no" />
        </cfif>

</cfif>

<!---//  get the info from the database //--->
<cfquery name="getInfo" ...>
Select the info here...
</cfquery>

<!---// 
if the info from "getInfo" query is what populates the form, (and I'm
assuming it does) then you'll want to create cfparams for the form 
fields and use the getInfo results as the defaults
//--->

</cfsilent>

<!---// build the form //--->
<form action="thispage.cfm" method="POST">
....the form
</form>

..:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.23/591 - Release Date: 12/17/2006
3:17 PM
 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264263
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to