Sorry, I forgot to mention that the script is triggerd by the onChange event of 
the grid. (just in case it matters)

> Can anyone tell me why this code works fine when used with a Flash 
> type cfgrid, but not with an html type cfgrid? Is there something in 
> the code that is telling it that it's binding to a Flash type grid? 
> Basically, this code does EXACTLY what I need it to, but I need it to 
> work on an HTML form with an HTML grid.
> 
> <cfsavecontent variable="calculateTotal">
  
> var totalAmount = 0;
  
> var item;
  
> var subTotal = 0;
  
> for(var i = 0; i < cart.length; i++) {
    
> item = cart.getItemAt(i);
    
> subTotal = number(item['price']) * item['quantity'];
    
> totalAmount += subTotal;
    
> cart.editField(i, 'amount', subTotal);
  
> }
  
> total.text = totalAmount;
> </cfsavecontent> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350070
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to