I wouldn't submit directly to the cfc... I would submit to another template
that invokes the CFC, passing arguments to it from the form or attributes
scope.
<cfobject component="myCfc" name="myCfcObject">
<cfinvoke component="#myCfcObject#" method="setMyMethod"
returnvariable="myReturn">
<cfinvokeargument name="myArgument" value="#form.myFormVariable#">
</cfinvoke>
Or:
<cfscript>
myCfcObject = CreateObject("component", "myCfc");
myReturn = myCfcObject.setMyMethod(form.myFormVariable);
</cfscript>
Jim Rising
Sr. Cold Fusion Developer
ICGLink Inc.
www.icglink.com
-----Original Message-----
From: Steve Sequenzia [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 11, 2007 4:47 PM
To: CF-Talk
Subject: Submitting form to .cfc page
I am pretty new to using ColdFusion components but I am trying to start
doing all my inserts and queries with them.
In the past I would always submit my forms to another .cfm page (usually
called action). On that page I would do my SQL inserts or whatever and then
put a <cflocation> at the bottom that directed the browser to the proper
destination page. I am not really sure if this is best practice coding but
it always worked for me.
When using components it seems like I should be submitting the form to the
..cfc by making it the action page of the form. That all works fine and the
database inserts are working but the browser ends up on the .cfc page. I am
not sure the best way to redirect to the proper .cfm destination page.
Normally the destination page will be different depending on the source
page.
I hope this all makes sense.
Any help on this would be greatly appreciated.
Thanks in advance.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2
Build sales & marketing dashboard RIAâs for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283514
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4