Question
Dynamic variable names and invalid_character_err
I'm neither an expert at structure notation nor dynamic
variable naming conventions and would appreciate any help with the
following. Thanks!
This code works fine.
<cfset idx="123">
<cfset form.product[idx]=StructNew()>
<cfparam name="form.product[idx].product_nm" default="Raspberry Jam">
<cfform name="data_entry" method="post" format="flash" height="525" width="675" action="formdump.cfm">
<cfformgroup type="tabnavigator" height="400" width="650">
<cfformgroup type="page" label="Product #idx#">
<cfinput name="static_form_name" type="text" label="Product" value="#form.product[idx].product_nm#" height="350" width="600" readonly="yes">
</cfformgroup>
</cfformgroup>
</cfform>
The following code results in the following error: "ORG.W3C.DOM.DOMEXCEPTION ERROR. Message: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified." The only change is in the "name" attribute of the <cfinput> tag:
<cfset idx="123">
<cfset form.product[idx]=StructNew()>
<cfparam name="form.product[idx].product_nm" default="Raspberry Jam">
<cfform name="data_entry" method="post" format="flash" height="525" width="675" action="formdump.cfm">
<cfformgroup type="tabnavigator" height="400" width="650">
<cfformgroup type="page" label="Product #idx#">
<!--- Change value of name attribute from "static_form_name" to "product[idx].product_nm" --->
<cfinput name="product[idx].product_nm" type="text" label="Product" value="#form.product[idx].product_nm#" height="350" width="600" readonly="yes">
</cfformgroup>
</cfformgroup>
</cfform>
Pam Grieger
plgrieger@fedex.com
This code works fine.
<cfset idx="123">
<cfset form.product[idx]=StructNew()>
<cfparam name="form.product[idx].product_nm" default="Raspberry Jam">
<cfform name="data_entry" method="post" format="flash" height="525" width="675" action="formdump.cfm">
<cfformgroup type="tabnavigator" height="400" width="650">
<cfformgroup type="page" label="Product #idx#">
<cfinput name="static_form_name" type="text" label="Product" value="#form.product[idx].product_nm#" height="350" width="600" readonly="yes">
</cfformgroup>
</cfformgroup>
</cfform>
The following code results in the following error: "ORG.W3C.DOM.DOMEXCEPTION ERROR. Message: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified." The only change is in the "name" attribute of the <cfinput> tag:
<cfset idx="123">
<cfset form.product[idx]=StructNew()>
<cfparam name="form.product[idx].product_nm" default="Raspberry Jam">
<cfform name="data_entry" method="post" format="flash" height="525" width="675" action="formdump.cfm">
<cfformgroup type="tabnavigator" height="400" width="650">
<cfformgroup type="page" label="Product #idx#">
<!--- Change value of name attribute from "static_form_name" to "product[idx].product_nm" --->
<cfinput name="product[idx].product_nm" type="text" label="Product" value="#form.product[idx].product_nm#" height="350" width="600" readonly="yes">
</cfformgroup>
</cfformgroup>
</cfform>
Pam Grieger
plgrieger@fedex.com
