Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

Bootstrap modal hidden.bs.modal event fires multiple times?

When confirm popup closes the hidden.bs.modal event fires multiple time, I added page update action but it calling multiple times.

$("#bsModel").on("hidden.bs.modal", function (e) {

        e.preventDefault();

    //isOk is set to true when ok button clicked

        if (isOk) {

           //Data update call when model closed

        }

    });  

Answers


Try following code with off("hidden.bs.modal") this will solve your problem,

$("#bsModel").off("hidden.bs.modal").on("hidden.bs.modal", function (e) {
 e.preventDefault();
 //isOk is set to true when ok button clicked
        if (isOk) {
           //Data update call when model closed
        }
    });  

Share your answer


Share as a guest

Please subscribe me to the CodeChef4U.

By creating your new answer, you agree to the privacy policy and terms of service.