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

Reply via email to