OK, I'm a little stumped here.
I have a loop that has 17 rows. It's looping over results from the database
on a pervious page:
<cfloop index="pmt" from = "1" to = "#form.numrows#">
What I need to do is grab the form value from the previous page. It's a
checkbox:
<input type=checkbox name="paid_#reg.currentrow#" value="Confirmed" <cfif
#Trim(reg.payment)# eq "Confirmed">checked</cfif>
Next I want to store it in the database with the value:
<cfloop index="pmt" from = "1" to = "#form.numrows#">
<cfset pd="#form['paid_' & pmt]#">
<cfset rid="#form['regid_' & pmt]#">
<cfif isDefined("form.paid_#pmt#") and #Trim(pd)# eq "Confirmed">
<cfquery datasource="#dsn#" name="upreg">
UPDATE dbo.ShowRegistration SET Payment='Confirmed' WHERE
(RegistrationID=#rid#)
</cfquery>
When I try to run it I get the following error:
Element paid_1 is undefined in a Java object of type class
coldfusion.filter.FormScope.
The error occurred in E:\Websites\gmclubofns\forum\updpayment.cfm: line 10
8 : <body>
9 : <cfloop index="pmt" from = "1" to = "#form.numrows#">
10 : <cfset pd="#form['paid_' & pmt]#">
11 : <cfif isDefined("form.paid_#pmt#") and #Trim(pd)# eq "Confirmed">
12 : <cfset rid="#form['regid_' & pmt]#">
What am I doing wrong? Am I referencing the values in a loop correctly?
Thank you for your help.
Rick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322074
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4