0

hi frens..

i ll simplify my requirement and explain the issue..

lets say, i have 3 textbox rate, quantity, total and a "add row" button. I must be able to add any no. of rows. There must also be a supertotal field before the "add row" button to display the total of totals. after entering rate and quantity, the total and supertotal should get calculated automatically without refresh.

I am able to add rows successfuly, but total is getting calculated for only 1st row..
here is the code

$(document).ready(function()
{
	$("#rate").change(function()
	{
 
		var rate, qty, total;
		rate = parseFloat($("#rate").val());
		qty = parseFloat($("#quantity").val());
		total = qty*rate;
		if(!isNaN(total))
		{
			$("#total").val(total.toFixed(2));
		}
		else
		{
			$("#total").val("There was a error");
		}
	});
});

how can i get this thing to work for all rows and also calculate the supertotal?
plss help me out with this..

thanks

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by puvi
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.