1
I have a problem in my web system done in PHP/Laravel
:
I have a loop loop and inside this loop I have a button for each item, which opens a modal of bootstrap, as follows:
<button name = "btnAbrirDetalhes" data-toggle = "modal" data-target = "#modalDetalhesPedido" class = "btn btn-primary" data-id="{{$sanduiche->id}}">Detalhes</button>
<div class="modal fade" id="modalDetalhesPedido" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content" style = "height: 900px">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"></span></button>
<h4 class="modal-title" id="myModalLabel" style = "font-weight: bold">Detalhes do Pedido (Nome do pedido)</h4>
</div>
<div class="modal-body" style = "height: 195px;">
<p name="id"></p>
<h1 id = "nome">Nome</h1>
<h2 id = "preco">Preco: R$ 20,00</h2>
<input type = "checkbox" name = "" value = "bacon">Bacon<br>
<input type = "checkbox" name = "" value = "bacon">Mussarela<br>
<input type = "checkbox" name = "" value = "bacon">Tomate<br>
<input type = "checkbox" name = "" value = "bacon">Alface<br>
<input type = "checkbox" name = "" value = "bacon">Salsicha<br>
<input type = "checkbox" name = "" value = "bacon">Presunto<br>
</div>
</div>
</div>
</div>
These buttons when used in Chrome, do absolutely nothing. When I go to firefox, they work.
Can anyone tell me why?
NOTE: I cannot use this system in firefox because other bugs in it
There is an error in the console?
– BrTkCa
Take a look at Bootstrap code versions if they are the same, CSS and JS, and also see if you put Jquery right before Bootstrap etc.
– Not The Real Hemingway
@Lucascosta No error on the console. An interesting fact is that in Chrome I have another button, independent of these, that opens another modal, and it works smoothly.
– Gabriel Augusto
@Nottherealhemingway Yes, they’re the same and Jquery is before Bootstrap I think it’s a problem that there are two modals on the same page, but both have different ids. I did a test putting two modals on the same page using an html file and had no problems, but on this system I am having problems :(
– Gabriel Augusto
Another important OBS is that I’m using Ubuntu, the Chrome version here is at 49.0, I think that might be it... I can’t find newer versions for Ubuntu, Chrome doesn’t update more automatically, maybe in Ubuntu the latest version was this...
– Gabriel Augusto
@Gabrielaugusto Uso the version
17.10
of Ubuntu and I’m withChrome v.56.0.2924.87
. Quite late in your version. But the Modal issue should work, regardless of that.– William Aparecido Brandino
bootstrap is tested on all browsers before it goes into production, surely it is some error in your code, which version of Bootstrap is using? to 3 or 4?
– Leandro RR
in addition, each modal has to be triggered by its own button, the button has to point to the ID corresponding to the modal.
– Leandro RR