我有下表:
该表格来自此代码:
<table class="table table-bordered">
<thead>
<tr>
</tr>
</thead>
<tbody>
<tr ng-repeat="1 in [1, 2, 3, 4, 5]">
<td>Name: <input type="text" ng-model="name" size="40" /></td>
<td>Amount: <input type="text" ng-model="amount"/></td>
<td>Date: <input type="date" ng-model="date"/></td>
</tr>
</tbody>
</table>
<center><button>Send</button></center>
如何发布这些行的值?
答案 0 :(得分:0)
将信息作为数组发布应该会有所帮助。将您的tbody
更改为此类
<tbody>
<tr ng-repeat="1 in [1, 2, 3, 4, 5]">
<td>Name: <input name="table[]" type="text" ng-model="name" size="40" /></td>
<td>Amount: <input name="table[]" type="text" ng-model="amount"/></td>
<td>Date: <input name="table[]" type="date" ng-model="date"/></td>
</tr>
</tbody>
并使用table
检索$_POST['table']
,这会给您类似的内容:
array (
0 => 'John'
1 => '90'
2 => 'june'
)