Target a Specific Page with the Back Button

In support we get asked if we can have the back button target a specific page. Though this is not a built-in feature, we do have a script for that! In our survey below if you click the back button you will be sent to the Thank You Page. 

Check it out in an example survey.

OR

Add a survey with this setup to your account!

Setup

On the page(s) you'd like this to happen click Add New Action > JavaScript and paste the code below. 

//Set this variable to Page ID that the back button will be sending to.
var pageID = 1;

$(document).ready(function(){
$('.sg-back-button').attr("onclick","$('sg_navchoice').value='sGizmoBackButton';this.form.action=this.form.action+'?__sgtarget="+pageID+ "&';return(true);");
});

Required Customization

The only modification you'll need to make is to change var pageID = 1 to the page ID you'd like the respondent to jump to. For more information on question, page and option ids check out our tutorial on How to Find Ids.

Then do some testing. Go through your survey and see if your back button redirects to the correct page. If for any reason it doesn't, check your page IDs. 

Scripting and Other Custom Solutions

We’re always happy to help you debug any documented script that is used as is. That said, we do not have the resources to write scripts on demand or to debug a customized script.

If you have customization ideas that you haven't figured out how to tackle, we're happy to be a sounding board for Alchemer features and functionality ideas that might meet your needs. Beyond this, check out our Professional Services; these folks have the scripting chops to help you to achieve what you are looking for!

Basic Standard Market Research HR Professional Full Access Reporting
Free Individual Team & Enterprise
Feature Included In