Re: storing a cfinput inside of a variable
Thanks to everyone who suggested passing it an attributeCollection - you learn something new each day (well, more than one thing reading this list!) To do what you want, provide dynamic parameters to the tag. Use the attributeCollection where you can define the attribuetes as a structure and pass it to the cfinput... (or any other CFML) tag. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332815 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: storing a cfinput inside of a variable
The only option would be to evaluate the variable, and even that might not work: cfoutput #Evaluate(config.formFieldA)# /cfoutput -Original Message- From: Steve Logan [mailto:st...@sagescholars.com] Sent: Thursday, April 08, 2010 1:37 PM To: cf-talk Subject: storing a cfinput inside of a variable Is there anyway to use cfset or cfsavecontent to store a complete cfinput tag? i.e. cfset config.formFieldA = cfinput type=text name=fieldname value=// If I do a view source, I see it the code on my output page, but it won't render at all in the browser. If I try cfsavecontent it errors because the cfinput isn't in a cfform (since the cfinput is in a CFC being called by the form page). The reason for this is that this one form field could have different max lengths, validations, validation patterns, and messages based on a variety of factors. If I can move the input into a CFC that returns all sorts of other partner specific info, it keeps me to having just one space to enter config data. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332803 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: storing a cfinput inside of a variable
I think you want to be coding the actual input tag that is sent to the browser. If you are not using any of the advanced features of the cfinput... tag, all it does is generate an input... html tag. Skip the middle man and generate your own html tag. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332804 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: storing a cfinput inside of a variable
On 4/8/2010 11:37 AM, Steve Logan wrote: Is there anyway to use cfset or cfsavecontent to store a complete cfinput tag? i.e. cfset config.formFieldA = cfinput type=text name=fieldname value=// If I do a view source, I see it the code on my output page, but it won't render at all in the browser. If I try cfsavecontent it errors because the cfinput isn't in a cfform (since the cfinput is in a CFC being called by the form page). The reason for this is that this one form field could have different max lengths, validations, validation patterns, and messages based on a variety of factors. If I can move the input into a CFC that returns all sorts of other partner specific info, it keeps me to having just one space to enter config data. Disregard my previous reply. You are trying to have your cake and eat it too. I.E. you are using the advanced features of the cfinput... tag. cfinput needs to be processed on the server to build the HTML and JavaScript code to send to the browser. To do what you want, provide dynamic parameters to the tag. Use the attributeCollection where you can define the attribuetes as a structure and pass it to the cfinput... (or any other CFML) tag. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332805 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RE: storing a cfinput inside of a variable
Hey Steve, Can you tell us what the bigger picture is, what is it that you are trying to accomplish by saving the cfinput in a variable? cfinput is rendered by coldfusion for the browser in respect to the cfform tags that are around it. Are you trying to create a reuseable form field where you can just paste the results into your form by calling the variable, for any given form you may create? There are different methods for handling different scenarios. You could create a structure that you set at the top of the page and then copy/paste the cfinput that uses that structure for its settings. You could create a function that creates the cfinput field, and then call that function everywhere that you want that cfinput to show up. Let us know where you want to go, and we can help you get there. :) -- William E. Seiter On Apr 8, 2010, Andy Matthews li...@commadelimited.com wrote: The only option would be to evaluate the variable, and even that might not work: cfoutput #Evaluate(config.formFieldA)# /cfoutput -Original Message- From: Steve Logan [mailto:st...@sagescholars.com] Sent: Thursday, April 08, 2010 1:37 PM To: cf-talk Subject: storing a cfinput inside of a variable Is there anyway to use cfset or cfsavecontent to store a complete cfinput tag? i.e. cfset config.formFieldA = cfinput type=text name=fieldname value=// If I do a view source, I see it the code on my output page, but it won't render at all in the browser. If I try cfsavecontent it errors because the cfinput isn't in a cfform (since the cfinput is in a CFC being called by the form page). The reason for this is that this one form field could have different max lengths, validations, validation patterns, and messages based on a variety of factors. If I can move the input into a CFC that returns all sorts of other partner specific info, it keeps me to having just one space to enter config data. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332806 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: storing a cfinput inside of a variable
Steve, Is there anyway to use cfset or cfsavecontent to store a complete cfinput tag? i.e. cfset config.formFieldA = cfinput type=text name=fieldname value=// If I do a view source, I see it the code on my output page, but it won't render at all in the browser. If I try cfsavecontent it errors because the cfinput isn't in a cfform (since the cfinput is in a CFC being called by the form page). The reason for this is that this one form field could have different max lengths, validations, validation patterns, and messages based on a variety of factors. If I can move the input into a CFC that returns all sorts of other partner specific info, it keeps me to having just one space to enter config data. That doesn't work, instead do something like: cfset fieldA = { type=text , name=fieldname , value= } / cfinput attributeCollection=#fieldA# / You can use a structure to define the parameters for the cfinput / tag. -Dan ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332807 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm