1
Why doesn’t my modal close?
I couldn’t find anything wrong, especially when compared to other similar fashions that I have.
When I click the close button, it does not give the Ismiss, do not understand.
JS is added and I have other similar modals in my system, I don’t know what’s wrong with this.
Can someone help me?
<!-- Modal -->
<div class="modal fade" id="adicionar" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<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">Adicionar</h4>
</div>
<div class="modal-body">
{{ Form::open(array('route' => array('tipos.store'), 'method' => 'POST')) }}
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label for="">Nome do tipo</label>
<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
<input type="text" placeholder="Casa, Apartamento, Sobrado..." required name="nome" id="" class="form-control">
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<button type="submit" class="btn btn-success waves-effect waves-light">Salvar</button>
</div>
</div>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
</div>
There seems to be nothing wrong with the modal. Run a test: run this code on the console
$("#adicionar > div > div > div.modal-header > button").click(function(){alert("ok")})
... then click on the X of the modal and see if thealert
is fired.– Sam
You can ask the question the library used and how to open the modal, self or by clicking on an element?
– user60252