Basically, I want to make sure that the user must manually close the javascript warning and that the user cannot just exit the warning by pressing enter.
(This sounds malicious, but in the application you click, enter a lot, and I need to make sure that they do not miss the important information that their warning gives).
I tried to set document.onkeydown to no avail:
document.onkeydown = disabled;
and then in the disabled function
function disabled(event) {
if (event.keyCode==13) {
event.preventDefault();
}
}
Is there a way to do this without moving on to using modals?
source
share