Join us and the lead editor of IRL, Mozilla's multi-award-winning podcast, for a behind-the-scenes look at the pod and to contribute your ideas for the next season, themed: "AI and ME." Mark your calendar and join our Community Call on Wednesday, Aug 7, 17:00–17:45 UTC. See you there!

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

On alert box message grey page need to disable all keyboard characters except enter

more options

Have written a code to disable backspace key in fire fox , its working fine and displaying alert correct alert box. Whenever alert box is getting displayed , i am pressing again back space key then it is going to previous page. So need to disable the backspace key on alert pop up also..

                                         In chrome browser all keyboard characters are disabled except enter key..

so expecting the same thing in Firefox also..

Have written a code to disable backspace key in fire fox , its working fine and displaying alert correct alert box. Whenever alert box is getting displayed , i am pressing again back space key then it is going to previous page. So need to disable the backspace key on alert pop up also.. In chrome browser all keyboard characters are disabled except enter key.. so expecting the same thing in Firefox also..

모든 댓글 (4)

more options

Perhaps Firefox allows the Back button -- the backspace key is equivalent to the Back button -- because users do not like being trapped by dialogs?

Have you considered handling this event: window.onbeforeunload?

Edit: Updated documentation: beforeunload

글쓴이 jscher2000 - Support Volunteer 수정일시

more options

Note that Firefox has a build-in way to disable the backspace key.

more options

Thanks for your reply..

  In beforeunload function i am unable get the event code.. wrote alert box for event keycode getting  message as undefined  

Need to disable following pop up (Please check attached image)

more options

Your existing function could set a global flag that you check in the function that runs onbeforeunload; does that work?

I'm not aware of any way to get rid of the dialog.