Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

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

  • 4 பதிலளிப்புகள்
  • 6 இந்த பிரச்னைகள் உள்ளது
  • 4 views
  • Last reply by jscher2000 - Support Volunteer

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..

All Replies (4)

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 மூலமாக திருத்தப்பட்டது

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

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)

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.