Jason,

You can post directly to a function from within a CFC if you specify  
'access="remote"' in the function tag (then set your form to post to   
"mycfc.cfc?method=postMyData"), but for many reasons, in most cases,  
it's better to call the function from within your .cfm.   Something  
like this:

<!--- If we're posting our form --->
<cfif isDefined('FORM.submit')>
<!--- Create our Component Instance and Post the Data --->
<cfset dataposted = createObject("component","cfc.mycfc").postMyData 
(FORM)/>
</cfif>

As you can see, you can accomplish all of your actions within a few  
lines of code in your template.   Here's a good article from Ben  
Forta on the subject:  http://www.adobe.com/devnet/coldfusion/ 
articles/intro_cfcs.html

I  also suggest reading the chapter on Coldfusion Components   
thoroughly in your CF WACK book.

Jon

On Nov 11, 2006, at 2:16 PM, Jason T. Slack wrote:

> Can I call a .cfc file from an form on Post? What I am trying to due
> is distinguish what parts of my site are pure CF code and what other
> parts are tied to pages that will be displayed to the user.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:260041
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