Does anyone know how to fix this issue in my code? I need to reload a modal for another database query after a successful operation
if(result === 'success'){
$("#editarModalOcup").modal('hide');
$('#success .modal-body').html('Information: ' + data.message);
$('#success').modal('show');
$('#success').on('hidden.bs.modal', function () {
/*$('#editarModalOcup').on('hidden.bs.modal', function() {
$(this).removeData('bs.modal');
});
$("#editarModalOcup").modal('show');*/
});
}
However, this code is not working as expected and the button shows a forbidden signal preventing me from using it. Any suggestions?
Thank you!
UPDATE HTML Modal:
<div class="modal fade" id="editarModalOcup" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header modal-header-success">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3><i class="fa fa-pencil-square-o"></i> Edit Occupancy Room</h3>
</div>
<div class="modal-body">
<!-- The form is placed inside the body of modal -->
<form id="editarOcupacao" method="post">
<div class="form-group">
<input type="hidden" name="edit_ocupacao" id="edit_ocupacao">
</div>
<div class="form-group">
<input type="hidden" name="edit_dia" id="edit_dia">
</div>
<div class="form-group">
<input type="hidden" name="edit_tempo" id="edit_tempo">
</div>
<div class="form-group">
<label for="recipient-name" class="control-label">Room:</label>
<input class="form-control" name="edit_sala_nome" id="edit_sala_nome" disabled="true">
</div>
<!-- More form fields here -->
</form>
</div>
</div>
</div>