BKBK, Where do you put this line of code: <cfloop index="i" for="1" to="12"> <cfset currentFieldName = "productQuantity" & i> <cfinput type="text" name="#currentFieldName#"> </cfloop> I was receiving an error that said there was an Attribute validation error for tag CFLOOP. The Valid Attributes are: ARRAY,CHARACTERS,CHARSET,COLLECTION,CONDITION,DELIMITERS,ENDROW,FILE,FROM,GROUP,GROUPCASESENSITIVE,INDEX,ITEM,LIST,QUERY,STARTROW,STEP,TO so I changed the For to From, and it went through, but it's still not working. Where do I put this loop? Above the CFOUTPUT, or inside the Form, or inside the IF isDefined("form.submit") line? I get different results where I put it. Does the text box you wrote in the code above, replace the text box I have? Or do I still need the IF isDefined("form.submit") statement and just use the text box you wrote above in this IF statement? This is how I currently have everything: <cfoutput> <cfform name="ShoppingCart" action="ShoppingCart.cfm" method="post"> You have #arrayLen(Session.ShoppingCart.Products)# items in your cart.<br /><br /> <cfloop index="i" from="1" to="#arrayLen(Session.ShoppingCart.Products)#"> <table> <tr> <td>#Session.ShoppingCart.Products[2]#</td> <cfif isDefined("Form.submit")> <cfloop index="i" from="1" to="12"> <cfset currentFieldName = "productQuantity" & i> </cfloop> <cfinput type="text" name="#currentFieldName#" value="#currentFieldName#"> <cfelse> <td><cfinput type="text" name="productQuantity" value="#Session.ShoppingCart.Products[3]#"></td> </cfif> <td><a href="ShoppingCart.cfm?deleteID=#i#">Delete</a></td> <td><input type="submit" name="submit" value="submit"></td> </tr> </table> </cfloop> </cfform> </cfoutput> When I run this though, it just outputs "productQuantity12" into each text box. If I change the CFLOOP to this: <cfloop index="i" from="1" to="#arrayLen(Session.ShoppingCart.Products)#">, it outputs "productQuantity8" into each text box since there are 8 items in my cart currently. The text box you wrote above did not have any value, so I was not able to see anything in the text box, so I added this: value="#currentFieldName#" What am I still doing wrong? Do I need to use this code at all? If so, how? <cfif StructKeyExists(url,'editID')> <cfset Session.ShoppingCart.Products[form.editID][1] = form.productID> <cfset Session.ShoppingCart.Products[form.editID][2] = form.productName> <cfset Session.ShoppingCart.Products[form.editID][3] = form.productQuantity> </cfif> Andy
... View more