【发布时间】:2014-07-04 21:45:20
【问题描述】:
这是我的 html 表格代码,其中包含用于填充 html 表格数据的 php foreach 循环, 我想通过 form.serialize 将整个表数据作为数组发布到我的控制器 在阿贾克斯, 我可以这样做吗?怎么做??
<table class="table table-striped table-vcenter table-bordered">
<thead>
<th>Master Name</th>
<th>From No.</th>
<th>To No.</th>
<th>Total</th>
</thead>
<tbody>
<?php foreach ($master as $name) { ?>
<tr class="rc1_tr">
<td class="td_amount"><div id="amount"><?php echo $name['amount']; ?></div></td>
<td id="form_no"><div id="div_to_no"><?php echo $name['receipt_no_to'] ? $name['receipt_no_to'] : '0'; ?></div></td>
<td align='center' class="qt" id="<?php echo $name['id'] ?>" style="width: 250px;"><input type="text" id="to_no" class="quantity" value="" style="text-align:center;width:180px;height:26px;margin-bottom: 2px;"/></td>
<td id="td_total"><div id="total"></div></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr class="grand_total">
<td colspan="3">Grand Total</td>
<td><div id="div_grand_total"></div></td>
</tr>
</tfoot>
</table>
【问题讨论】:
-
想在ajax调用中通过form.serialize方法发帖