How to disable back button and backspace using Javascript..?

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Apr 2007
Posts: 26
Reputation: BalagurunathanS is an unknown quantity at this point 
Solved Threads: 0
BalagurunathanS's Avatar
BalagurunathanS BalagurunathanS is offline Offline
Light Poster

How to disable back button and backspace using Javascript..?

 
0
  #1
Sep 4th, 2007
Hi Friends..
In my web application(ASP.net), i need to disable the "Back" button in the browser.Moreover i also need to disable the Backspace key in my keyboard when my web page is run..How to do it with javascript..? Someone help with javascript as early as possible..
Regards,

Balaguru
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: How to disable back button and backspace using Javascript..?

 
0
  #2
Sep 4th, 2007
You can't disable the back button. The best you can do is to open a new window with JavaScript and remove that toolbar. But if the page loads in a window with the toolbar you can't disable it.

You also can't disable the keyboard but you can use JavaScript to ignore certain keys from being acted upon. You need to intercept the event and then ignore it.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 4
Reputation: sandeep.mk is an unknown quantity at this point 
Solved Threads: 0
sandeep.mk sandeep.mk is offline Offline
Newbie Poster

Re: How to disable back button and backspace using Javascript..?

 
0
  #3
Sep 11th, 2007
HI

how to disable IE back button , as my jsp page conatins 3 frames , so how can i disable/ stop the operation of back/forward button.

regards
sandeep.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 26
Reputation: BalagurunathanS is an unknown quantity at this point 
Solved Threads: 0
BalagurunathanS's Avatar
BalagurunathanS BalagurunathanS is offline Offline
Light Poster

Re: How to disable back button and backspace using Javascript..?

 
0
  #4
Sep 11th, 2007
Sorry Sandeep..

It caused a lot of problems for me..I gave it up..

Regards,
Balagurunathan S
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: How to disable back button and backspace using Javascript..?

 
0
  #5
Sep 11th, 2007
Both of you need to read my post. I gave you the answer in there.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 3
Reputation: sreekiran is an unknown quantity at this point 
Solved Threads: 0
sreekiran sreekiran is offline Offline
Newbie Poster

Re: How to disable back button and backspace using Javascript..?

 
0
  #6
Sep 12th, 2007
using
<script>
function disable()
{
document.getElementById("").Disable=true
}
</script>
<body>
using this function in ur onclick="disable()" method
</body>
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: How to disable back button and backspace using Javascript..?

 
0
  #7
Sep 12th, 2007
That doesn't work for the back button since it isn't part of the web page.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 164
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: How to disable back button and backspace using Javascript..?

 
0
  #8
Sep 13th, 2007
The "Back" button belongs to the user, not to you. You have no right to disable it, since it might be the only way the user has to return to the page he came from to get to your page.

I have seen people use such tricks as removing the toolbar or forwarding to a second page. These make me mad at the programmer, because he denies me the opportunity to complete my tree search of a Google request or another website.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,609
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 464
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: How to disable back button and backspace using Javascript..?

 
0
  #9
Sep 14th, 2007
The annoyance with the 'Back' button, I fear is not universal. There are cases (read Intranet applications) where the client has requirements for the web application to look like a desktop application, making the removal of toolbars necessary.

BalagurunathanS, the only way to disable the back button is to remove the entire toolbar in the way mentioned by Midimagic in his previous post.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: How to disable back button and backspace using Javascript..?

 
0
  #10
Sep 14th, 2007
For Intranet applications; it's much easier to control the browser being used to access the page... Open VB6, drop WebBrowser control on form, don't add any buttons that call the control's 'back' event; save; compile; backbutton-neutered IE6. Distribute to everyone onsite.

In any context, including Intranet applications, why should 'back' ever need to be disabled? Just accept it's there, and that it goes back ( to potentially anywhere ); and incorporate that into your plans. Don't overlook it up to the point that it becomes a problem.
Last edited by MattEvans; Sep 14th, 2007 at 4:41 pm.
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC