This code will result for 10 lines of textbox1, textbox2, and textbox3. If I enter value in first line of textbox which is in loop1. for example 1 and 3 it will multiply and result is 3 . but then it will display the result in all loop. How can i make it only in loop1.?
Example
QTY PRICE AMOUNT
line1 1 2 3
line2 3
line3 3
line4 3
line5 3
line6 3
line7 3
line8 3
line9 3
line10 3
PHP HTML CODE
<?php for($x=1; $x<=10; $x++){?>
<tr>
<td><input type="text" name="qty<?=$x;?>" class="qty form-control" size="6"/></td>
<td><input type="text" name="price<?=$x;?>" class="price form-control" /></td>
<td><input type="text" name="amount<?=$x;?>" class="amount form-control"></td>
</tr>
<?php } ?>
JS CODE
<script>
$(".price,.qty").keyup(function () {
$('.amount').val($('.qty').val() * $('.price').val());
});
</script>