On Mar 16, 2009, at 2:46 PM, ebru...@gmail.com wrote:

I am working on a order form. I now have the following:
*snip*

would change in the total price of all the products.

Any one how can assist me in this?

What I would do is give the <table> an id, such as "price_table", give each table row which contains an object a class "object" or something (anything that stands out), then give each price <div> a class, such as "object_price", and each quantity another class, such as "object_quantity". Then do something like:

var price = 0;
$("#price_table > tr.object").each(function() {
price += parseFloat(this.find("div.object_price").html()) * parseInt (this.find("div.object_quantity").html());
});
$("#total_price").html(price);

You get the general idea: use structured HTML, which makes it easy to traverse/parse it.

Regards,
--
Martijn.

Reply via email to