How can we not close the twitter-bootstrap modal by clicking outside the area?

Asked

Viewed 19,067 times

11

I do not know if there is a way, but I need to block the closing of the twitter-bootstrap modal when the user clicks outside the element area, only allowing to close it by clicking the closing buttons.

  • Just to complement the question: is the modal you refer to here? http://getbootstrap.com/javascript/#modals

1 answer

27


According to the documentation, just put the attribute data-backdrop="static" in your modal:

<div class="modal fade" data-backdrop="static">
    ...
</div>
  • 2

    I have already checked the documentation that this is it. + 1

  • Simple like this, it really helped me and it was enough that I had read the documentation a little more. And I thought it would be complicated. Of the lesser evils.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.