How do I disable the previous button in the middle of the survey? | XM Community
Solved

How do I disable the previous button in the middle of the survey?

  • 15 November 2017
  • 7 replies
  • 245 views

Userlevel 3
Badge +1
I want to allow participants to go back in most of the pages of the survey, but there are some pages where I don't want them to be able to go back. How do I disable the previous button in the middle of the survey?
icon

Best answer by AnthonyR 15 November 2017, 23:43

View original

7 replies

Userlevel 7
Badge +7
On questions where you do not want them to be able to go back, add the following to the AddOnReady section of the javascript editor:

$('PreviousButton').hide();
$('PreviousButton').disable();
Userlevel 3
Badge +1
Hm...I just tried adding this to my second question & the previous button still appears. I've attached the QSF below - any idea why this isn't working?
Userlevel 4
Badge +2
Could you also potentially create blocks in your survey, where the question where you don't want them to go back on is in a new block? You would need to have a branch condition between the blocks, but this could help you disable the button.
Userlevel 7
Badge +7
> @Barnaby said:
> Hm...I just tried adding this to my second question & the previous button still appears. I've attached the QSF below - any idea why this isn't working?

Whoops, this actually belongs in the addOnReady section. Sorry!
Userlevel 3
Badge +1
Thanks, @AnthonyR - that second option worked!
Hi!

This works, except if the questions is answered wrong on the page with the script (i.e. error message appears) then the button reappears. Do you have a solution for this?

AnthonyR Thank you for this! Really helpful!

Wondering if there is a way to reverse the JS and only show back buttons for specific blocks while disabling the Back Button option from the Survey Option tab?

Leave a Reply