Allow users to go back only one page? | XM Community

Allow users to go back only one page?

  • 17 January 2020
  • 7 replies
  • 113 views

Hello!

I am trying to figure out a way to allow users to go back only one page rather than being able to click back through all of them.

For example, if the user reaches page 4, they can only go back to page 3. So once they go back to page 3, the back button for that page should be hidden or disabled.

I am somewhat new to javascript so I'm not sure what my options are. Let me know if you have any ideas!

7 replies

Userlevel 1
Badge +3
Hi,

Could you please try this code by adding to your next question where you want to display the previous button, please let me know if this helps.

<samp>
jQuery(this.getQuestionTextContainer()).append('<button id = "PrevButton">Go Previous</button>');
var that = this;
function GoPrev() {
that.clickPreviousButton();}
document.getElementById("PrevButton").addEventListener("click", GoPrev);
<br/><br/>
</samp>
thank you! this somewhat answers my question.

but how could i hide this after the user leaves the page? for example, there will be a back button on page 3 when they get there after question 2. then once they reach page 4, they can go back to page 3, but the back button on page 3 should be hidden.
Userlevel 6
Badge +5
FYI, @TomG offers some custom code for purchase that does this and works well.
@TomG could i get more info on this??
Userlevel 7
Badge +27
> @tah77 said:
> @TomG could i get more info on this??

I responded by private message
Userlevel 1
Badge +2

Hey TomG
could you provide me the custom code? 🙂

Thanks!

Userlevel 7
Badge +27

https://community.qualtrics.com/XMcommunity/discussion/comment/46490#Comment_46490Send me a private message if you are interested in purchase.

Leave a Reply