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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop backspace acting as the Back Button

Status
Not open for further replies.

LokiDba

Programmer
Dec 13, 2000
63
GB
Hi,

Does anyone know how to stop the pressing of the backspace
key behaving like the Back button on the browser. Clausing
lots of problems on the Site.

Thanks in Advance

LokiDBA
 
I would suggest physically removing the backspace key from the keyboard - that should do it :)

If you're using IE, you can try to find a browser that doesn't use backspace as BACK button.

But I do know how frustrating it can be when you use backspace to modify content of input field, then click outside of it, and then accidentally press backspace again and all the data is lost :-( <Dmitriy>
dbrom@crosswinds.net
 
this is more client side problem. you can do it like this :

add this to a page and every time someone hits back they wont be able to go back as they will be driven forward again. this method also stops the browser back button from functioning correctly so may not be usefull for you.

<script language=&quot;JavaScript&quot;>
javascript:window.history.forward(1);
</script>

if you want to disable backspace you will have to handle key presses, which is not something i know how to do with a scripting language.

hope this helps




 
LokiDba,
I know what you are looking for, and I believe it is a onkeypress function to disable dec value 8 which is the backspace button...however, I cannot seam to get it to work on any of my pages, so I am still searching...seams like no one really knows unless you're useing freebsd unix...that's the only thing I can find as of yet with support on the subject.

Wrote a note to Microsoft...hopefully they will provide documentation on it within a few days or so. -Ovatvvon :-Q
 
Yeah, this is really not an ASP Forum question, I agree.

Belongs in the DHTML forum, which we don't have :-(

The problem you are going to have with catching the backspace is older and junkier (Netscrape) browsers.

Ovatvvon, you're scaring me. What is wrong with:




... as reference material?

If you can't use the MSDN Library I don't know how you accomplish anything. I'd be lost! The Netscrpae docs on this really suck, but be advised these events are handled VERY differently and have different limitations and strengths.

And what the heck does FreeBSD have to do with DHTML? ;-)
 
Well dilettante,

Regarding msdn library...I do know how to use it, if fact use it quite a bit, along with many other reference web sites, regarding the ref's you gave...
One, the typical onkeypress or onkeydown commands, from my experience, are written as part of a field command such as <input type='text' name='somthing' onkeypress=&quot;if (event.keycode = 55)...etc...however this is not going to solve the backspace problem moving the page in history because you already have the focus on a form element....however, I seam to have problems getting the backspace key to register anyway with that command and cannot seam to block the key value...which goes in with a problem with the next point of that the javascript (or whatever you use) will have ot be written for the page, which still cannot seam to register the backspace button for an onkeypress, onkeydown, or onkeyup...the three I have tried. I've tried this with IE 5.5 sp2, and NS 6.02.

Perhaps you, or someone else, have had better luck? If so, perhaps you could provide specific code showing an example of it as I would be interested on how you made it work. :)

Additionally, as-far-as the 'freebsd' issue is concerned, you are correct that the specific operating system wouldn't effect the outcome of the (d)html provided within the web site, and my mind was crossing projects we're working on here, so please forgive me for that mistake. P-)
-Ovatvvon :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top