Не понимаю я!
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/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);
}
$(".sum").each( function () {
allsum += parseInt( $(this).text(), 10 );
});
alert(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>
Написал такую фигню. В итоге allsum = NaN