Ask a Question related to Macromedia ColdFusion, Design and Development.
-
Chris Kemp #1
variable named field calculated from variable named fields
I have two form fields per line defined in a cfloop thusly:
<cfloop index="i" from= "1" to= "100" Step="1">
<cfif isdefined("form.item_number_" & "#i#")>
<tr>
<td>
<input type=text name="item_Quantity_" & "#i#"
value="#FORM["item_Quantity_" & i]#">
<input type=text readonly name="amount_" & "#i#"
value="#FORM["amount_" & i]#">
</td>
</tr>
</cfif>
</cfloop>
I want to add a third field name "extended_amount_" & "#i#"
whose value will be the product of the variably named item_quantity
and item amount fields.
What is the grammatical construction to calculate the extended amount
for each line?
Chris Kemp Guest
-
name of field is in variable: how to use in SQL?
Hi, The name of the field is in variable 'a'. How can i use it into SQL? This doesn't work: <% a="name" set obj =... -
Replacing variable data between fields - Revisited.
I posted a problem to the mailing list with a similar question I had some time ago regarding replacing data between fields. Unfortunately, I am... -
Replacing variable data between fields
I have a text file that has various addresses in different formats. I need to remove any items that are not part of the address so the output is... -
regexp catching variable number of name=value fields?
Hello, i have a configuration file where i am slowly migrating to XML like notation (tryed XML::Parser, but that one doesn't suit well into the... -
Variable in the field name.
Hi All, I have one question. Usually, we can get data from table by using rst("userid") because we know the column name userid. Now, I have a... -
mxstu #2
Re: variable named field calculated from variable namedfields
One way ..
<cfset extendedAmount = VAL(FORM["item_Quantity_" & i]) * VAL(FORM["amount_" & i])>
<input type="text" readonly name="extended_amount_#i#" value="#extendedAmount#">
mxstu Guest



Reply With Quote

