roger v
asked on
Coldfusion form variables - Bug that won't go away!
Hi,
I've been posting this chunk of code for a while and no matter what I do, the same bug keeps popping up and I'm unable to fix it. This is the error I get:
Element txt_approvers_2 is undefined in a Java object of type class coldfusion.filter.FormScop e.
The error occurred in C:\inetpub\wwwroot\xx\xxxx .cfm: line 156
154 : <input type="hidden" name="hRoleNameContactSour ce_#curren trow#" value="#form['hRoleNameCon tactSource _'& currentrow]#">
155 : <!--- <cfparam name="form.txt_approvers_# currentrow #" default="">--->
156 : <cfset variables.user = form['txt_approvers_' & currentrow]>
157 : <!---User:<cfoutput>#varia bles.user# </cfoutput >--->
Somebody please help!
I've been posting this chunk of code for a while and no matter what I do, the same bug keeps popping up and I'm unable to fix it. This is the error I get:
Element txt_approvers_2 is undefined in a Java object of type class coldfusion.filter.FormScop
The error occurred in C:\inetpub\wwwroot\xx\xxxx
154 : <input type="hidden" name="hRoleNameContactSour
155 : <!--- <cfparam name="form.txt_approvers_#
156 : <cfset variables.user = form['txt_approvers_' & currentrow]>
157 : <!---User:<cfoutput>#varia
Somebody please help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Tell whether you use the cfform attribute: preserveData="yes"
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fb7.html
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fb7.html
ASKER
@Zvonko:
I'm not using cfform, I'm using a regular form.
I'm not using cfform, I'm using a regular form.
When I see such lines then is my first expression is that you are fighting with the field values:
<input type="hidden" name="hRoleNameContactSour ce_#curren trow#" value="#form['hRoleNameCon tactSource _'& currentrow]#">
And the solution for that field value handling is the property: preserveData="yes"
Check this:
<input type="hidden" name="hRoleNameContactSour
And the solution for that field value handling is the property: preserveData="yes"
Check this:
<cfform name="myform" method="POST" preservedata="yes" >
<cfinput type="text" name="fld1" >
<cfinput type="checkbox" name="yourcheckbox" value="Manager" >
<input type="submit" name="mysub" value="Send" >
</cfform>
ASKER
That fixed the error but now I've got another problem - the checkbox is not being checked! I check the value of the variables.user to see it is "manager" and if it is, I check the checkbox. But now, even though the value is "manager" the checkbox is not being checked.