0
我想在用戶將數據輸入到數量字段中時將新行添加到表格的末尾。jQuery在將數據輸入數量字段時添加新表格行
我的表如下。我使用的是Bootstrap 3.1.1,以及jQuery 1.11
本質上,它是一個快速訂單表單。我希望能夠爲用戶提供足夠的領域來填補所有的時間。
<div class="container White_BG">
<div class="row" style="margin-left:0;margin-right:0;">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<h1>Quickly place your order with this form.</h1>
<h2>Please enter the item numbers that you wish to order; once you add to the cart, then you will be able to change the quantity of those items ordered.</h2>
<div class="table-responsive">
<form method="post" name="QuickOrderMulti">
<table class="table table-bordered table-condensed table-hover">
<tr>
<th class="active">Item #</th>
<th class="active">Quantity</th>
<th class="active">Description</th>
<th class="active">Price</th>
<th class="active">Subtotal</th>
</tr>
<tr>
<td class="col-lg-2 ProductNumber"><input type="text" name="ProductNumber"></td>
<td class="col-lg-2 Quantity"><input type="text" name="Quantity"></td>
<td class="col-lg-2 QuickDescription"></td>
<td class="col-lg-2 QuickPrice"></td>
<td class="col-lg-2 QuickSubtotal"></td>
</tr>
</table>
<input type="submit" value="Add to Cart" class="btn btn-default btn-orange">
</form>
</div>
</div>
</div>
</div>
好的,那麼如何將代碼包裹來檢查數量字段是否有價值?如果它有價值,那就是我想要提供一個新行的時候。 –
好的。查看更新的答案。 – mikeyq6
你是什麼意思是「你想插入的行的字符串版本」?只有一條線? –