Ehsaan Israr
Ehsaan Israr

Reputation: 637

Bootstrap modal open and close only one time then it does not work

enter image description here

When i run following command in chrome console

$("#inactive-selected-requests-modal").modal("show")

it does not display modal and overlay comes there. the chrome console output is:

<div class="modal fade" id="inactive-selected-requests-modal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" style="display: none;"></div>

Upvotes: 1

Views: 1712

Answers (2)

Ehsaan Israr
Ehsaan Israr

Reputation: 637

Problem is with below function, i was deleting the modal html instead of modal body

$(document).on("hidden.bs.modal", "#inactive-selected-requests-modal", function () {
            $("#inactive-selected-requests-modal").html("");
        });

To correct i change above function line to:

$("#inactive-selected-requests-modal-body").html("");

Upvotes: 0

XWiśniowiecki
XWiśniowiecki

Reputation: 1843

Remove style="display: none;". It has solved the problem for me.

Upvotes: 1

Related Questions