In a shown modal there is a form. If I focus on an input field (any field for that matter) and press ESC key, that modal is hidden. However, if I don\'t focus on a form fiel
Twitter's Bootstrap modal.js (see http://getbootstrap.com/2.3.2/javascript.html#modals) itself has keyboard true or false Boolean. You can avoid escape keypress and click outside the modal using following script:
$(function () {
$('.modal').modal({
show: true,
keyboard: false,
backdrop: 'static'
});
});
working demo :
$(function () {
$('.modal').modal({
show:true,
keyboard: false,
backdrop: 'static'
});
});
Hello, world!