i tried putting form inside foreach value passed in form right value result not last value. button inside form not submitting (nothing happens after clicking button).
<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 $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>
nevermind guys. tried putting value in button instead in input hidden type , im getting right value in post. :d
i rid of input type="hidden"
and make button way
<button class="btn" name="requestid" value="{{ $res->id }}">
Comments
Post a Comment