Hi,
The code you have written is not working for me.
I have a dynamic form where all the form element's names are taken from database. so it may be n1, gsd, sffr,sf like that.
What I am doing is taking all these into a hidden variable.
So may hiddenvariable name is suppose hvalue,
and the value is hvalue = Name,Age,Sex,Products etc.
what I am doing is splitting all these into a array and putting like this.
<cfset value="Form."&#Arr#>
If I print value then I am getting the following :
Form.Name
Form.Age
Form.Sex
Form.Products etc.
I want the value of the above. I dont want the string. Please help me to get the values.
I am attching my code also :
<cfoutput>
#form.NameOfActiveFields# - this is the array of names
</cfoutput>
<cfset FieldArr = ListToArray(#form.NameOfActiveFields#,","
>
<cfloop index="inti" from=1 to= #arrayLen(FieldArr)#>
<cfoutput>
<Cfset code="Form." & #FieldArr[inti]#>
</cfoutput>
<cfquery name="inst" datasource="max" dbtype="ODBC">
INSERT INTO InsertFormData values (13,'#form.formid#','#FieldArr[inti]#','#code#','12')
</cfloop>
In code I am not getting values. I am getting a string like form.name etc.
Thanks.
-SAHOO
The code you have written is not working for me.
I have a dynamic form where all the form element's names are taken from database. so it may be n1, gsd, sffr,sf like that.
What I am doing is taking all these into a hidden variable.
So may hiddenvariable name is suppose hvalue,
and the value is hvalue = Name,Age,Sex,Products etc.
what I am doing is splitting all these into a array and putting like this.
<cfset value="Form."&#Arr#>
If I print value then I am getting the following :
Form.Name
Form.Age
Form.Sex
Form.Products etc.
I want the value of the above. I dont want the string. Please help me to get the values.
I am attching my code also :
<cfoutput>
#form.NameOfActiveFields# - this is the array of names
</cfoutput>
<cfset FieldArr = ListToArray(#form.NameOfActiveFields#,","
<cfloop index="inti" from=1 to= #arrayLen(FieldArr)#>
<cfoutput>
<Cfset code="Form." & #FieldArr[inti]#>
</cfoutput>
<cfquery name="inst" datasource="max" dbtype="ODBC">
INSERT INTO InsertFormData values (13,'#form.formid#','#FieldArr[inti]#','#code#','12')
</cfloop>
In code I am not getting values. I am getting a string like form.name etc.
Thanks.
-SAHOO