I know that this site has a very similar question ( JavaScript: how to select "Cancel" by default in the confirmation field? ), But I felt I didn’t get a good answer from this, because my rooms do not match.
Description of the problem:. I am writing a Javascript popup in a web browser that should accept some information as input, and the user can choose between “OK” to process the information and continue with anything, or “Cancel” to close the window and return to what whatever. So far, so good. The problem is that some users click the “X” in the upper right corner of the pop-up window to close the window (by mistake or actually believing that the data has been processed) and get a second pop-up dialog box (you cannot change the text in this dialog box) displaying "Are you sure you want to go from this page?" - "Click" OK "to continue, or" Cancel "to stay on the current page" - OK / Cancel ...Now, some users simply press the enter key on their keyboard, and the pop-up window closes and all information is lost.
Question: Can you, or is there a workaround, set the focus to "Cancel" instead of "OK" when it comes to whether to close the Internet Explorer popup / tab or not
Thank you in advance! =)
Roger source
share