Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Disabling browser back button (chrome) + previous button

Hello all,

I have currently two issues:

1 - As the subject suggests, I need to disable the browser back button, at least in some questions on my questionnaire. With this purpose, I checked the "Survey Settings" -> "Browser Settings" -> "General Settings" -> "Disable Browser Back Button" option. But, as pointed in the SSI Web help, it is only working on Firefox, not in Chrome (I haven't tested it in other browsers).  Quoting the help:

"Disable Back Button

 By checking this option, the ability to back up in a survey is removed. This feature requires JavaScript to be enabled in the browser. In addition not all browsers support this feature (Chrome, iPhone, etc.)."

So, does anyone know how to achieve this on Chrome?

2 - Again, I need, at least in some questions, to disable the "previous" button / arrow. I thought that there was an "easy way" to do that, but I haven't found it. Is possible to do this? If yes, how?

If anyone can help, I will be deeply grateful.

Thank you in advance,
João
asked Jul 23, 2012 by João Fernandes Bronze (2,040 points)
retagged Sep 1, 2016 by Walter Williams

3 Answers

+2 votes
For #1, I don't know the answer.

For #2, click on the screwdriver icon to open up your general Survey Settings and select the General Format tab.  Then click on the Settings button under the Navigation Buttons area and deselect the box for the Previous Button.
answered Jul 23, 2012 by Brian McEwan Gold Sawtooth Software, Inc. (38,015 points)
Thanks Brian, I had it on front of my eyes and couldn't see it. In what concerns to #2, I'll ask it on Stack Overflow or something like that. If anyone knows something more, please let me know!
+2 votes
If disabling the browser back button doesn't work in your particular browser, such as Chrome, you can also use the Simple Browser option in your Survey Settings>Browser Settings tab. This will pop-up a JavaScript window which doesn't have a previous or next button on it. Unfortunately, if the browser has a pop-up blocker installed, this may be disabled. Apparently the browser companies believe their users don't like to relinquish control of paging to any website that requests this ability, and so they actively work to thwart browser hijacking.
answered Jul 24, 2012 by Nathan Bryce Silver Sawtooth Software, Inc. (7,450 points)
+2 votes
During my research, I found this -> http://www.aspsnippets.com/Articles/Disable-Browser-Back-Button-Functionality-using-JavaScript.aspx

Code:
<script type = "text/javascript" >
    function preventBack(){window.history.forward();}
    setTimeout("preventBack()", 0);
    window.onunload=function(){null};
</script>


I put it in the HTML header of the pages where I want to disable Chrome's back button. As far as I can see, it is working (I don't know if it works on other browsers, like IE, though)
answered Jul 24, 2012 by João Fernandes Bronze (2,040 points)
I can assure it works in IE (version 9, at least).
Hello all again,

I want to do an improvement to the code I posted above. I need to enable the browser back button but I can only let the user go back one page each time. Does anyone has a hint on this?

Thanks in advance,
João
<script type = "text/javascript" >
  function noBack(){
window.history.forward();
}
<body onload="noBack();">
Hey i used your code for disabling backing back button bur it not working on
i am also used these  two codes but notworking,backbutton is enabled
...