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
You can target that specific input by adding an ID to it and simply removing the keydown event for enter like so:
JS
$(document).ready(function() {
$('form input').keydown(function(event){
if(event.keyCode == 13) {
event.preventDefault();
return false;
}
});
});
This example works with the Enter Key.