Sawtooth Software: The Survey Software of Choice

Disable Back Button in Browser

I would like to disable the back button in all browsers so that a respondent can't use the browser to go back to previously-asked questions. How do I do this?

SSI Web has a built-in mechanism to disable the back button in most major browsers (see the Survey Settings > Browser Settings > Disable Browser Back Button check-box). But as you've probably discovered, all browsers may not behave the same way, which means the back button may still work in Chrome, iPhones, and less-known browsers. Below is another technique that may disable the back button functionality in your survey if an HTML5-compatible browser is being used and JavaScript is enabled. It makes use of JavaScript's history.forward method which loads the next URL in a history list. You'll place this code in the Survey Settings > Headers and Footers > HTML Head Tag section where it will disable the browser's back button on all pages in your survey.

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

If you're using older, non HTML 5 versions, the following code may work for you.

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

Sawtooth Software

6:30 AM to 5:30 PM Mountain Time
(GMT-6; GMT-7 Autumn/Winter)
Monday through Friday

Phone: +1 801 477 4700
Fax: +1 801 337 7410

SKIM Software

9:00 AM to 5:30 PM Central European
(GMT+2; GMT+1 Autumn/Winter)
Monday through Friday

Phone: +31 10 282 3500
Fax: +31 10 282 3560

We're open!

Lighthouse Studio

Lighthouse Studio is our flagship software for producing and analyzing online and offline surveys. It contains modules for general interviewing, choice-based conjoint, adaptive choice-based conjoint, adaptive choice analysis, choice-value analysis, and maxdiff exercises.

Try Lighthouse Studio

  Buy Lighthouse Studio