I use CFC's for processing form input (though I always structure my apps
with the MVC design pattern...)
Something like this (this may or may not be useful for you.. but I hope it
is!):
<cfcomponent ...>
<cffunction name="edit" output="false" ...>
<cfargument ...>
<!--- update the model --->
<cfscript>
model = createObject("component", "path.to.model.myModel");
model.init(arguments.id);
model.setFirstName(arguments.firstName);
model.setLastName(arguments.lastName);
model.setEmail(arguments.email);
if (model.getID() eq 0) {
model.create(); // create a new entry
} else {
model.update(); // update an existing entry
}
</cfscript>
<!--- update the view page --->
<cflocation url="formSubmitted.cfm?entryId=#model.getID()#"
addtoken="no">
</cffunction>
</cfcomponent>
-d
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:138192
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community.
http://www.fusionauthority.com/ads.cfm