17
votes

Is there an option in the bootstrap modal to make it stay modal even if the user clicks away from the modal? The modal dialog hides when the user click outside the dialog. I would like it to stay modal until the user clicks the close button.

3

3 Answers

32
votes

From the docs: http://getbootstrap.com/javascript/#modals

Specify a static backdrop option

$("#yourModal").modal({"backdrop": "static"});
15
votes

Add the attribute data-backdrop="static" to your modal div like so:

<div id="someModal" class="modal hide" data-backdrop="static">
    <div class="modal-header">
        ...
    </div>
    <div class="modal-body">
        ...
    </div>
</div>
2
votes

Demo here http://jsfiddle.net/SnhUg/1/

$("#example").modal({backdrop:false});