57
rated 0 times
[
62]
[
5]
/ answers: 1 / hits: 17099
/ 9 Years ago, fri, november 13, 2015, 12:00:00
I am adding values to table like:
Item,Quantity,Price,TotalPrice
Now there are multiple rows: How can i sum TotalPrice of all to get GrandTotal using Jquery.
Code:
$(#Product).append( <tr><td id='clientname'> +ClientName+ </td> <td id='item'>+ItemName+</td> <td id='quantity'>+Quantity+</td> <td id='price'>+Price+</td> <td id='totalprice'>+TotalPrice+</td> <td> <a onClick='deleteRow(this);'>Delete</a> </td> </tr>);
Its possible when i insert new row data its show grand total in textbox/label,Like:
function TotalPriceCalc()
{
var lblTotalPrice = document.getElementById('lblTotalPrice');
lblTotalPrice.value = sum;
}
More From » jquery