Hey Guys, I'm having a tad of an issue dealing with Dynamic Variable Names. What is happening is I have a CFC that builds part of form for me using some data in a table. Then the cfc sends the form's code back to the page as a string. Well I need to assign values to these form fields so people don't overwrite the data. I'm pulling the data in the function in the cfc. So I'm trying to throw this dynamic variable into the string and it is messing things up for me. I keep getting an error saying
A CFML variable name cannot end with a "." character.
Here is the code I'm using that gives me the error. I'm not all too experienced with programming I haven't been doing this too long. So ANY input would be awesome.
<!--- ================================================================== --->
<cfargument name="catFormQuery" type="query" required="yes">
<cfargument name="listingID" required="yes">
<cfset var getListingInformation = "">
<cfset var returnVar = "">
<cfset var fieldValue = "">
<cfset var catNameNoSpace = "">
<!--- get the listing Information --->
<cfquery name="getListingInformation" datasource="backEndDSN">
Select * from listings
where listingID = #arguments.listingID#
</cfquery>
<cfoutput query="arguments.catFormQuery">
<!---====================--->
<!--- Set catNameNoSpace --->
<!---====================--->
<cfset catNameNoSpace = replaceNoCase(arguments.catFormQuery.catName, " ", "_")>
<!---==========--->
<!--- for text --->
<!---==========--->
<cfif arguments.catFormQuery.catType eq 'text'>
<cfset returnVar = returnVar & #arguments.catFormQuery.catName# & ": <input type='text' name='#catNameNoSpace#' value=" & getListingInformation.#catNameNoSpace# & "><br />">
</cfif>
So anyway if you can give me any input or advice that would be great. Thanks a lot.
The code is right down here at the bottom.
<cfset returnVar = returnVar & #arguments.catFormQuery.catName# & ": <input type='text' name='#catNameNoSpace#' value=" & getListingInformation.#catNameNoSpace# & "><br />">