Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anyway to stop Internet Explorer Backspace

Status
Not open for further replies.

ironhide1975

Programmer
Feb 25, 2003
451
0
0
US
I find the Backspace key is problematic with form submissions. If a field in the form is not selected then the user is directed to the previous page. Is there anyway to disable this javascript or vbscript wise?

 
you can try this, and/or adapt it to suit your needs. note: the backspace will not work in the form element either. you'd seemingly have to loop through every text element in the form and make the onkeydown return true all the time to fix this issue.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Untitled</title>

<script type="text/javascript"><!--
function noBackSpace(e) {
    if (!e) var e = window.event;
	return !(e.keyCode == 8);
}
//--></script>
</head>

<body onkeydown="return noBackSpace(event);">
<form name="f"><input type="text" name="t1" /></form>
</body>
</html>



*cLFlaVA
----------------------------
[tt]( <P> <B>)[sup]13[/sup] * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top