Officeoff.ru,
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$('.str').on("keyup",".quantity, .price, .discount, .sum" ,function(){
var o=$(this.parentNode.parentNode);
var kol = o.find('.quantity').val();
var price = o.find('.price').val();
var discount = o.find('.discount').val();
var result = kol * price;
if (discount.length>0){
var discount = result / 100 * discount;
var result = result - discount;
}
if (!isNaN(result)) {
var result = Math.floor(result*100)/100
o.find('.sum').val(result);
}
var allsum = 0;
$(".sum").each( function () {
allsum += +(parseFloat($(this).val())||0).toFixed(2);
});
$('.allsum').val(allsum);
});
});
</script>
</head>
<body><table class='table'>
<tr class='str'><td><input name='quantity' class='quantity' type='text'></td><td><input name='price' class='price' type='text'></td><td><input name='discount' class='discount' type='text'></td><td><input name='sum' class='sum' type='text'></td></tr>
<tr class='str'><td><input name='quantity' class='quantity' type='text'></td><td><input name='price' class='price' type='text'></td><td><input name='discount' class='discount' type='text'></td><td><input name='sum' class='sum' type='text'></td></tr>
<tr class='str'><td><input name='quantity' class='quantity' type='text'></td><td><input name='price' class='price' type='text'></td><td><input name='discount' class='discount' type='text'></td><td><input name='sum' class='sum' type='text'></td></tr>
<tr class='str'><td colspan='3'></td><td><input class='allsum' type='text'></td></tr>
</table>
</body>
</html>