Answer the question
In order to leave comments, you need to log in
What is the correct way to accept JSON data in a Bootstrap3 modal?
Good afternoon! Can you please tell me how to correctly accept the data in the Bootstrap modal window? I have tables with users and in each row there are buttons to edit the user. They look like this:
<a class="btn btn-mini btn-success" data-toggle="modal" data-target="#myModal" href="/users/permission/{{$user->id}}"><i class="fa fa-user"></i></a>
<a class="btn btn-mini btn-info" data-toggle="modal" data-target="#myModal" href="/users/edit/{{$user->id}}"><i class="fa fa-pencil"></i></a>
<a class="btn btn-mini btn-warning" data-toggle="modal" data-target="#myModal" href="/users/password/{{$user->id}}"><i class="fa fa-key"></i></a>
<a class="btn btn-mini btn-danger" data-toggle="modal" data-target="#myModal" href="/users/block/{{$user->id}}"><i class="fa fa-eye-slash"></i></a>
<a class="btn btn-mini btn-danger" data-toggle="modal" data-target="#myModal" href="/users/delete/{{$user->id}}"><i class="fa fa-times"></i></a>
Answer the question
In order to leave comments, you need to log in
Firstly, loading data into a modal window via remote has already been marked as deprecated since version 3.3.0. In the 4th version of bootstrap, it will be removed altogether.
Secondly, which also follows from the first one, use the 'show.bs.modal'/'shown.bs.modal' events, load the data from the server with ajax on these events and form the modal-body based on the received data ...
It's not enough to get json, you also need to parse it. And the question here is no longer about laravel.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question