Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#sup_table-1 > tbody > ').append(
- '<td style="width: 60px;"><input style="width: 160px;" type="text" class="price number" id="price-'+vals+'"></td>'+
- '<td style="width: 60px;"><input style="width: 160px;" type="text" class="total" id="total-'+vals+'" readonly></td>'
- );
- var controls = function(num){
- $("#price-"+num).keyup(function(){
- var mult = 0;
- $("tr.price-qty").each(function () {
- // get the values from this row:
- var $val1 = $('#qty-'+num, this).val();
- var $val2 = $('#price-'+num, this).val();
- var $total = ($val1 * 1) * ($val2 * 1)
- $('#total-'+num,this).val(numberWithCommas($total));
- mult += $total;
- });
- $(".grandtotal").val(numberWithCommas($total));
- });
- }
- controls(1);
- function myFunction(){
- $("#sup_table-1 > tbody > tr").each(function(row, tr){
- var num = row+1;
- // var charges = $('#charges_name-'+asd).val();
- controls(num);
- console.log(num);
- });
- }
- myFunction();
Add Comment
Please, Sign In to add comment