Hello all,
I'm trying to hack Ben Forta's EmbedFields tag to create client variables
from passed form fields.
CF does not like the 6th line. It doesn't like "<cfset client.#form_element#
=...". It's generating an "Invalid Expression Format" error.
Can someone offer me a suggestion on a better way to do this... one that
works ;-)
<CFIF #IsDefined("FORM.fieldnames")#><!--- Check that fieldnames exists --->
<CFSET #fieldnames_processed# = ""><!--- Create empty list of processed
variables --->
<CFLOOP INDEX="form_element" LIST="#FORM.fieldnames#"><!--- Loop through
fieldnames --->
<CFIF #ListFind(#fieldnames_processed#, #form_element#)# IS 0><!--- Try to
find current element in list --->
<CFSET #form_element_qualified# = "FORM." & #form_element#><!--- Make
fully qualified copy of it (to prevent acessing the wrong field type) --->
<CFOUTPUT><cfset client.#form_element# =
"#Evaluate(form_element_qualified)#"></CFOUTPUT><!--- Set Client
variable --->
<CFSET #fieldnames_processed# = #ListAppend(#fieldnames_processed#,
#form_element#)#><!--- And add it to the processed list --->
</CFIF>
</CFLOOP>
</CFIF>
Thanks.
Bill Poff
--
ICONS, Inc.
http://icn.net
540.343.8322
______________________________________________________________________
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
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists