1
Hello, I am sending a form that is in a modal inside a page, however the modal simply does not send, it is in a page that is a return of an ajax (a search in the case), I do not know if it influences.
<div class="modal fade" id="finalizarMonitoramento{{$m->ID_CD_INTERNACAO}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="{{url('monitoramento/finalizaMonitoramento')}}" method="post">
<input type="hidden" value="{{$m->ID_CD_MONITORAMENTO}}" id="id_mot" name="id_mot">
@method('PUT')
@csrf
<input type="submit" class="btn btn-primary" value="enviar">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
this is the modal, when I send simply nothing happens. Some hint?
That is the route:
Route::put('/finalizaMonitoramento','MonitoramentoController@finalizaMonitoramento');
Tested whether the
url
and the token are generating correctly? And the route of theform
, with her is?– Dobrychtop
They are being generated yes, the route of the form is correct, the fact is that simply nothing happens when I send the form.
– André Tripode Colognesi
You can add your route to the question?
– Dobrychtop
Already added, check if there is any error please
– André Tripode Colognesi
Just one more question, you use some route name prefix?
– Dobrychtop
yes 'monitoring', the problem is not in the route, the problem is that the form is not sent, no error occurs.
– André Tripode Colognesi
You can try this https://stackoverflow.com/questions/31686089/form-submit-button-not-working-in-bootstrap-modal-window to answer your question, unfortunately I won’t have time to reproduce the error to try to help you
– Dobrychtop
What is the possibility of having some JS with preventDefault in the Submit of this form? Because from what I understand the form is not being submitted, correct?
– David Dias
No possibility, what I realized when I inspected the element is that the form opens and closes with nothing inside, the buttons stay out
– André Tripode Colognesi
What’s inside your Controller?
– Suporte Escritoriomovel
Check the network tab of the browser dev tools, confirm that there is the sending of the package in the form Submit. If there is no, the context of the doubt changes. If there is, already see which is the package’s answer to know the error.
– David Dias