I think the following would work in your CFM page

<cfset YourObject = createObject( "component", "YourObject" ) />
<cfset myMethod = YourObject[ form.method ] /> 
<cfset myMethod( argumentCollection = form ) />

form.method is ofcourse a hidden field in the form
<input type="hidden" name="method" value="insert" />

-- 
Taco Fleur
Senior Web Systems Engineer
http://www.webassociates.com


-----Original Message-----
From: Yexley Robert D Contr AFRL/PROE [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 1 March 2005 7:33 AM
To: CF-Talk
Subject: Run CFC method on form submit

I'm looking for some good documentation or a code sample for how I would
execute a method in a CFC on form submit. So far I haven't been able to find
what I'm looking for. What I'm trying to do seems like it ought to be fairly
straight forward. I've got a method in a CFC that inserts a record into a
database, it has 11 parameters. I've got an HTML form (not a <cfform>) in a
ColdFusion template, and I'd like to set the method of this CFC to be the
"method" for the form. When the form is submitted, I want the values of the
fields on the form (there are 11 of them, corresponding to each of the
parameters of the CFC method) to get passed into the CFC method as
parameters, and then run the method. Can somebody point me to some
documentation, or give me a good code sample? I've looked in the CFML
Reference, and also "Developing ColdFusion MX Application with CFML" as
well, and haven't been able to find anything that covers this sort of
scenario.

================
// YEX //



/*
|| Robert D. Yexley
|| Oracle Programmer/Analyst
|| Northrop Grumman IT
|| Contractor - Wright Research Site MIS
|| Det-1 AFRL/PROE Bldg. 18 Rm. 034A
|| Commercial: 937.255.1984
|| DSN: 785.1984
|| [EMAIL PROTECTED]
|| <)))><
*/





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196906
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to