javascript block backspace history back

RESOLVED DUPLICATE of bug 272820

Status

()

Firefox
Keyboard Navigation
RESOLVED DUPLICATE of bug 272820
13 years ago
13 years ago

People

(Reporter: Walter, Assigned: Aaron Leventhal)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; it-IT; rv:1.7.6) Gecko/20050318 Firefox/1.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; it-IT; rv:1.7.6) Gecko/20050318 Firefox/1.0.2

In the javascript:
<body onkeydown="cancelBack()">
<SCRIPT LANGUAGE="JavaScript">
<!--

function cancelBack(){   
	
if ((event.keyCode == 8 && (event.srcElement.form == null || 
event.srcElement.isTextEdit == false)) 	
|| event.keyCode == 37 && event.altKey || event.keyCode == 39 && event.altKey )
	{
	event.cancelBubble = true;
	event.returnValue = false;    }
}
//-->
</SCRIPT>
<form method="POST" action="#">
[..]
</form>

Javaconsole retunr me error in event.keycode:
event is not defined

in explorer this code works


Reproducible: Always

Steps to Reproduce:
1.Create a form with my code
2.Press backspace in a text box 
3.Press backspace in any other place of form (the browser go wrongly in previous
page)

Actual Results:  
the browser go wrongly in previous page

Expected Results:  
the browser ingnore the key pressed

Comment 1

13 years ago

*** This bug has been marked as a duplicate of 272820 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.