Global
Confirmed 65,987,629 +464,157 new today Deaths 1,519,571 +8,425 new today Recovered 45,663,480 Active: 18,804,578 Last updated: December 5, 2020 - 1:18 am (+05:30)
Home Bootstrap How to prevent bootstrap modal popup from close when clicking on it

How to prevent bootstrap modal popup from close when clicking on it

by Admin
bootstrap

Do you want that bootstrap modal don’t close on outside clicking? Put just simply the next code in your code recordsdata.

 

1st just simply replace this HTML code. Do not forget to Remove the Asterisk (*).
<*div id=”myModal” class=”modal fade” role=”dialog”*>

with this following code
<*div id=”myModal” class=”modal fade” role=”dialog” data-keyboard=”false” data-backdrop=”static”*>

and then add the following CSS code in to your .css file. Do not forget to remove the Asterisk (*).

Remember: Do Not Change the CSS Class Name. Because .modal-backdrop and .modal-open .modal is the default class name of bootstrap–

//CSS Code
.*modal-backdrop{display:none;*}
.*modal-open .modal{width: 300px;margin: 0 auto;*}

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Decline