Bobby,
This is kind of expanding the scope of the initial question, but  
using http.request_method can cause other problems down the road -  
especially when pages have multiple forms, or multiple submits (i.e.  
- an Update and Delete submits).

Better always to use the isDefined('FORM.submitName') to determine  
which business logic gets executed.

It's just my preference, but it also seems to me that a separate  
action page for forms is redundant if you  encapsulate your business  
logic into CFC's.

You can accomplish all you need to do in a single script block at the  
top of the template  (or the equivalent in CFML tags):

<cfscript>
mycomponent = createObject("component","components.component");
if (isDefined('FORM.update')){
dataupdated = mycomponent.doUpdate(FORM);
};
if (isDefined('FORM.delete')){
datadeleted = mycomponent.doDelete(FORM.mydeletevar);
};
</cfscript>

Just my 2 cents,

Jon

On Sep 21, 2006, at 4:13 PM, Bobby Hartsfield wrote:

> Most people (I would think) just include the action page when the  
> form was
> submitted. You could check for a specific form field or button. I  
> just check
> to see if the request_method is "POST".
>
>
> <cfif http.request_method is "POST">
>  <cfinclude template="actiontemplate.cfm" />
> </cfif>
>
> <form action="thispage.cfm"  method="post">
> </form>
>
>
>
>
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.405 / Virus Database: 268.12.6/453 - Release Date:  
> 9/20/2006
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253793
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