Taking a step back, why are you using a form validation CFC? Your goal is that you want to validate a form then send an email. So the simple way to do this is to post the form to itself, then at the top of the page detect whether the page is posted to itself, run it through some validation checks and then send the email. Why not just put the validation code right in the page or in a cfinclude, or in a custom tag, or in a UDF library. The concept of having a "form_validation.cfc" seems awkward. Is there a specific reason that you are doing this?
To more specifically answer your question, avoid the variables scope inside of a CFC if you can. You can use that, but it is generally considered bad design and it can lead to problems that are hard to troubleshoot. -Mike Chabot On Sat, Nov 1, 2008 at 12:28 PM, Rick Faircloth <[EMAIL PROTECTED]> wrote: > Hi, Dominic and thanks for the reply... > > The second option sounds more like what I'm wanting to do. > > And while reading your response, it occurred to me that if I > send the form data to a cfc for validation, and it validates, > I could just go straight to another method (how about to another cfc?) > for the email processing > without going back to the orginal form page and then to the > email processing cfc. (make sense?) > > So, I would go from form page to validation method, and if all validates, > straight to the email method to send emails. > > And from your description below, I would just refer to the > arguments.variables > in the second method as in the first? No, I guess I couldn't use the > "arguments" scope > and share variables between methods...I'd need to put the data into the > "variables" scope > to share between methods. Right? > > And, if that's so, I guess each form variable has to be established in > the first validation > method by translating each piece of data in to the variable scope with > <cfset variables.name = arguments.name> in order to share those > variables within a CFC. > > Am I correct? > > Thanks for the feedback. > > Rick > > Dominic Watson wrote: >> Something like this? >> >> <cfif someObject.validateTheForm(argumentCollection = form) > >> <cfset variables.foo = >> anotherObject.doSomethingWithForm(argumentCollection = form) /> >> <cfelse> >> Form did not validate >> </cfif> >> >> Or, are you wanting to pass the form data to another cfc method from >> within the validation method? If so, something like this: >> >> <cffunction name="validateTheForm" ...> >> <cfargument name="foo" ... /> >> <cfargument name="bar" ... /> >> >> <cfscript> >> ... >> someOtherObject.doSomethingWithFormData( argumentCollection = >> arguments ) ; >> ... >> </cfscript> >> </cffunction> >> >> Dominic >> >> 2008/11/1 Rick Faircloth <[EMAIL PROTECTED]>: >> >>> Hi, all... >>> >>> Can form variables be passed around between a calling page and >>> multiple cfc's? >>> >>> I have a form with data I want to validate, then generate an email with. >>> >>> I have the calling page with the form, which sends the form data via >>> argumentCollection, >>> to a form_validation.cfc. If the form data passes validation, then I >>> want to send the form >>> data to an email_processing.cfc for email generation. >>> >>> Would the form variables be available to the calling page and both cfc's >>> in this case? >>> Or do I need to create session variables or another type of variable to >>> pass the values >>> around? >>> >>> Thanks, >>> >>> Rick >>> >>> >>> >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314721 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

