Global
Confirmed 162,619,110 +86,332 new today Deaths 3,373,574 +2,472 new today Recovered 141,598,937 Active: 17,646,599 Last updated: May 15, 2021 - 7:04 pm (+05:30)
Home Coding 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;*}

Related Articles

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