09-20-2019, 02:46 PM
(09-20-2019, 10:43 AM)Jose Nilton Pace Wrote: Hi Soren. You can put this code in your form:
Code:<head>
<script>
$(function() {
document.body.onkeydown = function(e){
if (e.keyCode == 121) {
$("#IWBUTTON_GRAVAR").click(); /*F10*/
}
};
});
</script>
</head>
Hi Jose,
It works nicely. Thanks. Also with (e.key === "F10"), which is a bit easier than remembering all the keycodes.
I have tried with (e.keycode == 27) and (e.key === 'Escape') as well, trying to trap the ESC key to click the "cancel" button, but it do not work. It's like the ESC keydown is being blocked before getting to the function. Do you know if there is anything else one has to do to get the ESC to be passed to the function ?
Regards
Soren