0
我試圖把我的表單放在foreach中,以便表單中傳遞的值是結果的正確值而不是最後一個值。但表單中的按鈕沒有提交(單擊按鈕後沒有任何反應)。Laravel表單按鈕裏面沒有提交的foreach
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Receiver's Name</th>
<th>Receiver's Contact</th>
<th>Package Type</th>
<th>Date Requested</th>
</tr>
</thead>
<tbody class="list">
@foreach($result as $res)
<form role="form" method="POST" action="/search ">
<input type="hidden" name="requestID" value="{{ $res->id }}">
<tr>
<td class="name"> {{ $res->receiverLname }},
{{ $res->receiverFname }}</td>
<td class="contact"> {{ $res->receiverContact }} </td>
<td class="type"> {{ $res->packType }} </td>
<td class="date"> {{ $res->updated_at }} </td>
<td><button class="btn"> View Transaction </button></td>
</tr>
</form>
@endforeach
</tbody>
</table>