I have an HTML table structure that looks something along the lines of:
PRICE QUANTITY TOTAL
[5____] [2____] 10 (TOTAL1=PRICE1*QUANTITY1)
The values in the price and quantity column are editable. These are HTML form fields.
The values in the total column are not editable. Instead they are direct functions of the columns to the left.
The HTML representation of the table is:
<table id="some_id">
<tr>
<td><input type="text" name="price1" value="5" /></td>
<td><input type="text" name="quantity1" value="2" /></td>
<td><input type="readonly" name="total1" /></td>
</tr>
</table>
Using jQuery I'd like to make it so that the value of "total1" always reflects the value of "price1" times "quantity1".
Question: I understand that there are numerous way to achieve this - but what would be the cleanest most concise way to do it using jQuery?
Since "auto-updating/derived fields" should be a quite common jQuery use-case I would assume that there exists some best practice method to achieve this.