JSFiddle - React, Tailwind, and code Playground
by 3rror404
HTML
<tr>
<td><a href='javascript:void(0);' class='remove3'><span class='glyphicon glyphicon-remove'></span></a></td>
<td><input type="text" onchange="fetchdetails(this)" class="Product_Code" name="Prdtcode[]" class="form-control input-xs Product_Code " required></td>
<td><input type="text" class="Product_Name" name="Prdtname[]" class="form-control input-xs"> </td>
<td><input type="text" placeholder="Qty" class="Qty" onkeyup="movetoNext(this, 'addMore3')" name="Qty[]" class="form-control input-xs" required></td>
<td><input type="text" class="Rate" class="form-control input-xs" placeholder="Rate" name="Rate[]" value=""></td>
<td><input type="text" class="Value" class="form-control input-xs" name="amount[]" value=""></td>
</tr>
</tbody>
</table>
<div class="form-group ">
<label class="col-md-4 control-label">BILL TOTAL:</label>
<div class="col-md-4">
<input type="text" placeholder="Amount" class="form-control input-xs" name="tot" class="TieTotal" value="">
</div>
JavaScript
$(document).on('keydown','input', function () {
$('.Qty').on("input change",function(){
var price = 0;
var total = 0;
$('.tb3 tr').each(function() {
var qty = $(this).find('.Qty').val();
var rate = $(this).find('.Rate').val();
var price = qty * rate;
$(this).find('.Value').val(price);
total = total+price;
});
$('.TieTotal').val(total.toFixed(2));
});
$('.Value').on(function(){
$('.tb3 tr').each(function() {
});
$('.TieTotal').val(total.toFixed(2));
});
});