How you include the action is of course up to you. CFC, Custom Tag, straight
code, sending it to billy bob's remote service... etc, etc...

The point of using isdefined over http.request method is rather moot since
it's only necessary to use something else when you have more than one form
on the page. Even then, I'd use both to decide if a form was submitted and
which one it was. I prefer not to check for buttons by name to decide which
action the person wants to take; as a matter of fact... I avoid using more
than one submit BUTTON as much as possible ;-)

-----Original Message-----
From: Jon Clausen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 21, 2006 4:34 PM
To: CF-Talk
Subject: Re: CFinput submit Action page

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:253796
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