Disabling the back button in all the browsers

Disabling the back button in all the browsers

I have a requirement like this,

    I have to disable back button of all the browsers(It should support all the browsers). Can u plz help me.
View Answers

June 14, 2011 at 4:15 PM

Hi Suresh

Given below code in Java script will disable the working of Back button :

<SCRIPT type="text/javascript">
    window.history.forward();
    function noBack() { window.history.forward(); }
</SCRIPT>
</HEAD>
<BODY onload="noBack();"
    onpageshow="if (event.persisted) noBack();" onunload="">

July 14, 2012 at 8:42 PM

**Sometimes we have requirement in developing a website to disable the Back button effect from Browser. This is common in Online Banking Websites and other sites where security is of principal concern. User may hit back and navigate from the page and forget to logout. Following are few tricks that can be used to disable the back button in browser. Please note that we do not literally √Ę‚?¨Ň?disable√Ę‚?¨¬? the back button, but just nullify its effect is some case and hide it altogether in others.**

You will get the example with the code below.

Ads









Related Tutorials/Questions & Answers:
Disabling the back button in all the browsers
Disabling the back button in all the browsers  I have a requirement like this, I have to disable back button of all the browsers(It should support all the browsers). Can u plz help me
disabling back button
disabling back button  hi, i am trying to make an application and i... press back button i again reach to the back page ie. authentication page so if any one can help me how to disable this button
Advertisements
disabling the browser's back button
disabling the browser's back button  I have following requirement, After submitting the form, user should not navigate to the previous page. I have tried with onbeforeunload(), but it is not working properly. Please help me
Back button
Back button  how to redirect to a home page when a back button is pressed in jsp instead of displaying the previous page
Disabling submit button using jQuery
Disabling submit button using jQuery  Hello Sir I want to know - is there any way or approach to disable client side form's "Submit" button. Please give code also.   For all submit buttons, via JQuery, it'd
navigation item back button
navigation item back button  I wants to add a navigationBar on the top of my UIWebView also a navigation item "back button". can anyone please explain how the back and refresh button works
Browser's back button
Browser's back button  how to redirect to a home page when browser's back button is pressed in jsp instead of displaying the previous page
Enable Browser's back button
Enable Browser's back button  how to redirect to a home page when browser's back button is pressed in jsp instead of displaying the previous page
Browser's back button
Browser's back button  how to redirect to a home page when browser's back button is pressed in jsp instead of displaying the previous page
PushViewController back button
PushViewController back button  How can i hide the back button... it always show back button.   In your ViewDidLoad method just hide the navigation back button as given in the code. navigationItem.hidesBackButton = YES
browser back button
browser back button   hi...i created one page in JSF.that page had three form division.in first form one add button is there.if i click that button move to second form,then i click browser back button ,it moves on another page.so
back button in jquery
back button in jquery  Creating a back button in JQuery   <script src="/javascript/jquery.min.js"></script> <script type="text/javascript"> ¬†¬†¬†¬†$(document).bind("mobileinit", function(){ ¬†¬†¬†¬†¬
uinavigationcontroller back button not showing/ missing
uinavigationcontroller back button not showing/ missing  Hi, In my... but ... somehow in the next view uinavigationcontroller back button not showing...... as the uinavigationbar back button use the title of the previous view
Enabling and Disabling Button In JSF
Enabling and Disabling Button In JSF  ...; In this tutorial enabling and disabling a button on different conditions has been explained. A button can be disabled setting "disabled"
JSP Back Button
JSP Back Button          Jsp Back Button enables the user back... illustrate an example from 'JSP Back Button'. To understand the example we have used
Should not logout after clicking the back/forward button
Should not logout after clicking the back/forward button  Hi all I... he clicks on the back button user automatically gets logged out. very next if clicked the forward button user gets logged in..!! how can I solve this issue? What
click on back button go to the login page
click on back button go to the login page  now when i click on back button the page show that page on where i came from and it shows the session expired but i want when i click a back buttob then it should show a login page
Browser Back Button click event javascript
Browser Back Button click event javascript  I am using the below code but window.onBeforeUnload is not working with back button.. how can i apply the below code for the click event of back button? window.onBeforeUnload
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p  Hi, I have designed a "back" button for jsp page. Now I want to disable Browser's default button So that people will use "back
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p  Hi, I have designed a "back" button for jsp page. Now I want to disable Browser's default button So that people will use "back
Session expire and back button in jsp and servlet .
Session expire and back button in jsp and servlet .  Hii Sir, I have to make a login and logout page with sessions .Now i have... previous pages by clicking back button of browser without again logging. Plz
After Logout Back Button Should not work again
After Logout Back Button Should not work again  Hi deepak,, I am doing Login Page,.. IN That If Logout Then When I Click Logout Button It Should...")!= null){ //then show the logout button }else{ // show the login button
forwarding request to a jsp when user clicks on back button in ie
forwarding request to a jsp when user clicks on back button in ie  Hi all, I have developed a web based application. After user log out... we forward request to a jsp page whenever user clicks on back button
How to disable browser back and forward button after logout [in struts2 or jsp]
How to disable browser back and forward button after logout [in struts2 or jsp]  How to disable browser back and forward button after logout... click the back button of the browser more than one time
How to disable back button in browser using javascript
There are times while developing a website, we need to disable back button... of the time the back button is disabled because a user can hit back... that will disable the working of Back button in Browser: <SCRIPT type="
Browser Back Button Disable/Hide/Invisible using Java Script
Browser Back Button Disable/Hide/Invisible using Java Script  Dear Sir, Please Help..., Q: How to Write Code For Browser Back Button Disable/Hide/Invisible using Java Script without Page Reload/Refreshing. anyone
How to prevent from navigating to a page after reaching Login page using back button?
login page using back button and agin click browser forward button,the 2nd page...How to prevent from navigating to a page after reaching Login page using back button?  Hi sir, I have created 2 pages, 1) Lo gin Page 2)Page
How to prevent from navigating to ck buttonnext page when user reaches login page using back button
goback to user login page using back button and agin click browser forward button,the 2nd page session gets expired but on next click on forward button,the pdf... page using back button  Hi sir, I have created 2 pages, 1) Lo gin Page
disabling commandlink
disabling commandlink  how can i disable commandlink through javascript. My requirement is that once the link is disabled the user should not be able to click on it. The commandlink.disabled attribute only disables the link
Disabling Login Functionality
Disabling Login Functionality  I have a textarea box, on clicking which the login box appears. When the user enters his login credentials successfully,the page gets refreshed. But on clicking the textarea box again(when the user
Jsp code for disabling record.
Jsp code for disabling record.  I want a Jsp and servlet code for the mentioned scenario. Q. A cross sign appears in front of each record, click to disable the record.System marks the record as disabled.The record

Ads