Prevent key entry from closing warning

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?

+4
source share
2 answers

Is there a way to do this without moving on to using modals?

. alert , . , ( "" ), - , . , , .. , , , .

+8

kludgy , , , - , 'enter' , .

0

All Articles