How can i select the next element?
Here is the html code:
<form method="post" action="" id="product_form">
<table width="100%" cellpadding="2" cellspacing="0" border="1" bordercolor="#666666">
<tbody>
<tr bgcolor="#F3F3F3">
<th><p>Item No.</p></th>
<th><p>P.order#:</p></th>
<th><p>Description</p></th>
<th><p>Qty</p></th>
<th><p>U.price</p></th>
<th><p>Amount</p></th>
</tr>
<tr class="mytr">
<td id="orders">
<input type="text" name="product[]" class="products" id="product" size="10">
<button class="add" type="button">+</button>
</td>
<td align="right">
<input type="text" name="porder[]" class="porder" id="porder" size="5">
</td>
<td align="right">
<input type="text" name="description[]" class="description" id="description" size="50">
</td>
<td align="right">
<input type="text" name="qty[]" class="qty" id="qty" size="5">
</td>
<td align="right">
<input type="text" name="uprice[]" class="uprice" id="uprice" size="5">
</td>
<td align="right">
<input type="text" name="amount[]" class="amount" id="amount" size="5">
</td>
</tr>
</tbody>
</table>
</form>
Here is the jquery code:
$('#product_form').on("keyup", "td .uprice", function (e) {
$(this).parent().next('td .amount').val(50);
});
http://jsfiddle.net/boajay/p3sFh/23/