Hide back button for entire blocks | XM Community
Skip to main content
Solved

Hide back button for entire blocks

  • September 20, 2023
  • 3 replies
  • 344 views

Forum|alt.badge.img+4

Hello

 

I have been adding a line of javascript to the questions where I need the back button turned off, but this is taking way too long as I have lots of repeated questions with slight variations depending on the respondent.

Essentially, can I set it to turn off the back button for an entire block, rather than just one question. I have set an embedded variable called BackButton = 1 or 0 for on and off but can’t get any javascript to operate it properly.

 

Cheers

Russell

Best answer by Deepak

 @RElsdon 

If you have an embedded data written before block 0 or 1 you can include below code in header> source which would work for your entire survey.

<script>
Qualtrics.SurveyEngine.addOnReady(function()
{
var showback = "${e://Field/BackButton}";

if (showback== 0) {

jQuery("#PreviousButton").hide();

}

});
</script>

Hope it helps!

3 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • September 20, 2023

@RElsdon - Post your JavaScript.


Nam Nguyen
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • 1096 replies
  • September 20, 2023

@RElsdon You don’t need to add JS code to every question. You just need to add it once in each page (if you have page brake in the block). If you want to turn it off for all, go to survey setting → response → Turn off back button

Hope this helps


Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+46
  • 1555 replies
  • Answer
  • September 20, 2023

 @RElsdon 

If you have an embedded data written before block 0 or 1 you can include below code in header> source which would work for your entire survey.

<script>
Qualtrics.SurveyEngine.addOnReady(function()
{
var showback = "${e://Field/BackButton}";

if (showback== 0) {

jQuery("#PreviousButton").hide();

}

});
</script>

Hope it helps!