PDA

View Full Version : [CLOSED]Backspace key in Firefox


Ducky
03-09-2010, 03:27 PM
I was in one of my Valence screens using Mozilla Firefox as my browser and accidentally hit the Backspace key. The screen immediately went blank. It had the same effect as if I had hit the back button on the browser. When I pressed the forward button on the browser it took me to the screen that I had been on previous to the one where I had accidentally hit Backspace. This is no doubt a browser issue but has anyone using Firefox found a way to negate this?

richard.milone
03-09-2010, 06:11 PM
There is code in the main portal page to protect this when the portal frame has focus. From within your program when a field on the page does not have the focus the browser will interpret that as a shortcut to the back button. To prevent this behavior add the following code to the bottom of the main JavaScript for your program:


// disable the backspace button so the user will not accidentally navigate off the page
var map = new Ext.KeyMap(document, [{
key: Ext.EventObject.BACKSPACE,
fn: function(key, e){
var t = e.target.tagName;
if (t !== "INPUT" && t !== "TEXTAREA") {
e.stopEvent();
}
}
}]);