I have a form with a set of checkboxes. There could be any number of
rows of checkboxes, since the fields are populated from the database
(values come from a lookup table). I am passing the number of rows to
expect when the form is processed via the "discount_category_count"
form field. The set of field names are "ind_inpatient_1",
"ind_inpatient_2", etc.
The code:
<cfloop index="i" from="1" to="#FORM.discount_category_count#" step="1">
<cfscript>
tmp = structnew();
tmp.ind_inpatient = 0;
tmp.ind_outpatient = 0;
if (isDefined(FORM["ind_inpatient_"][i]) AND
FORM["ind_inpatient_"][i] EQ 1) {
tmp.ind_inpatient = 1;
}
if (isDefined(FORM["ind_outpatient_"][i]) AND
FORM["ind_outpatient_"][i] EQ 1) {
tmp.ind_outpatient = 1;
}
tmp.discount_amt = FORM["discount_value_"][i];
tmp.ind_invoice = FORM["ind_invoice_"][i];
</cfscript>
</cfloop>
The problem is, this is throwing the following error:
Element ind_inpatient_ is undefined in a Java object of type class
coldfusion.filter.FormScope referenced as
and the line number for the error is the first IF statement in the
cfscript block.
What am I doing wrong?
Thanks.
Pete
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270210
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4