A modal box (Modal) is a subform that is overridden on a parent form. Typically, the goal is to display content from a single source, and you can have some interaction without leaving the parent form. Subforms can provide information, interactivity, and so on. Bootstrap modal box by default, click on a different blank area (usually the mask layer), the modal box will be closed, the following method is to prevent clicking on other areas to close the modal box.
$ (' #myModal '). Modal ({backdrop: ' static ', keyboard: false});
Backdrop:static, the blank space is not closed.
The ESC keyboard does not close when Keyboard:false.
The above code is also used to open modal boxes.
You can also use the following methods:
<div class= "modal" id= "Mymodal" tabindex= "-1" role= "dialog" aria-labelledby= "Mymodallabel" aria-hidden= "true" data-backdrop= "Static" data-keyboard= "false" >
<div class= "Modal-dialog custom-dialog succ-dialog" >
<div class= "Modal-content" >
<div class= "Modal-header" >
<button type= "button" class= "Close" data-dismiss= "modal" aria-label= "close" ><span aria-hidden= "true" > ×</span></button>
</div>
<div class= "Modal-body" >
<div><p><span> bid success! </span></p></div>
</div>
</div>
</div>
</div>
The data-backdrop= "Static" here specifies a static background that does not close the modal box when the user clicks outside the modal box. Data-keyboard is when the escape key is pressed to close the modal box and set to False when the key is not valid.
BootStrap Modal box disable blank place click Close