vendredi 29 avril 2016

foreach loop is repeating form fields laravel

Tomorrow i am going to present my code in sprint. All was working fine till few hours ago. i have a modal which popus when user clicks on Edit. It was giving the values according to id

<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
@foreach($Community as $editCommunity)
<h4 class="modal-title">Edit: {!! $editCommunity->community_name !!}</h4>
</div>
<div class="modal-body">
<form class="form-group" action="/update/" method="post" id="editCommunityForm">
<input type="hidden" name="_token" value="">
<input type="text" name="community_name" class="form-control" value="">
</form>
@endforeach
<button class="btn btn-custom dropdown-toggle waves-effect waves-light" type="submit" form="editCommunityForm">Update Community</button><br /><br />
</div>
<div class="modal-footer">

</div>
</div>

</div>
</div>

I am very upset and confused and don't know what to do. Any help would highly be appreciated

See this image to get proper understanding



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire