Prevent Bootstrap Modal from disappearing when clicking outside or pressing escape? [duplicate]

If using JavaScript then:

$('#myModal').modal({
    backdrop: 'static',
    keyboard: false
})

or in HTML:

<a data-controls-modal="your_div_id" data-backdrop="static" data-keyboard="false" href="#">

Works too, data-backdrop="static" to click out and data-keyboard="false" to Esc in your div modal:

<div id="idModal" class="modal hide" data-backdrop="static" data-keyboard="false">