disable back space button
Moderator: General Moderators
disable back space button
hi guys i want to disable the back space button bcoz i click it for removing the words from text box it is going back to previous page so kindly help in this regards if any one know
Re: disable back space button
wrong forum. you need to use javascript to detect a specific keypress and assign it an action. .
Re: disable back space button
so any one know java script for that issue kindly help me in this regards
waiting for ur replies
thanks
waiting for ur replies
thanks
Re: disable back space button
All you need to do is to use google...
This will disable it in text areas. Put this in the < head> section.
This will disable it in text areas. Put this in the < head> section.
Code: Select all
<script type="text/javascript">
function stopBKey(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 8) && (node.type=="text")) {return false;}
}
document.onkeypress = stopBKey;
</script>Re: disable back space button
That would get extremely annoying. Fast.
Re: disable back space button
Exactly what I was thinking.McInfo wrote:The only reason I can think of that the backspace key would cause the browser to go back a page instead of removing characters from a text input is if the text input does not have focus.
Re: disable back space button
SHHHH!!! I get a good laugh when I think of all those people trying to fix their typos and wondering what the hell happend to their keyboard.
(Ok, I also didn't know not having set the focus could do that...)
(Ok, I also didn't know not having set the focus could do that...)
Re: disable back space button
my issue was that when i enter back space button from my keyboard it goes to previous but that is happening when there is no thing selected in the form so i want to stop that back howz that possible???
Re: disable back space button
guys i used this code for that issue it is working properly but back space button is not working on text area can any one tell me why that is happening how can i solva that issue now???
<script type="text/javascript">
if (typeof window.event != 'undefined')
document.onkeydown = function()
{
if (event.srcElement.tagName.toUpperCase() != 'INPUT')
return (event.keyCode !=
;
}
else
document.onkeypress = function(e)
{
if (e.target.nodeName.toUpperCase() != 'INPUT')
return (e.keyCode !=
;
}
</script>
<script type="text/javascript">
if (typeof window.event != 'undefined')
document.onkeydown = function()
{
if (event.srcElement.tagName.toUpperCase() != 'INPUT')
return (event.keyCode !=
}
else
document.onkeypress = function(e)
{
if (e.target.nodeName.toUpperCase() != 'INPUT')
return (e.keyCode !=
}
</script>
Re: disable back space button
Which browser, version, and OS are you using?
Re: disable back space button
dear same code i have used and same problem is on my side i am using windows server2003 and browser is internet explorer so kindly tell me which changes i have to do to resolve that issue??