Javascript Button that Jumps to the last block, not the survey end | XM Community
Solved

Javascript Button that Jumps to the last block, not the survey end

  • 26 September 2018
  • 5 replies
  • 58 views

Userlevel 2
Badge +3
I have a button in my footer that is displayed all the time. When it is clicked, I want it to jump to the last block in my survey (or any block I specify).

I think I do this by making the button a Jump button. FWIW: I am using a Table of Contents, so I think Jump Buttons apply.
icon

Best answer by MohammedAli_Rajapkar 26 September 2018, 16:57

View original

5 replies

Userlevel 7
Badge +27
The Jump button brings you back to the table of contents (TOC). You enable it by checking the TOC option "Show Button".

So, your button would have to set an embedded variable, then click the Jump button. A script attached to the TOC (in a message) would have to look for the embedded variable then click the link for the block you want to go to (which has to be included in the TOC).
Userlevel 7
Badge +20
Hi @red5

You will have to find the button id of the button on which if someone click then it should take them to the last block of the table of content.

Find out the ButtonID and FlowID (last block of TOC)

Add below code under the "header" section of "Look & Feel"

jQuery("#ButtonID").click(function()
{
jQuery("a[id='BlockID']").click();
});
Userlevel 2
Badge +3
@Mohammedali_Rajapakar_Ugam
That works! Thank you. Genius. My customers will be happier now.
Userlevel 2
Badge +3
@LaurenK
I meant for this to be a question, not a discussion. Will you please convert it so I can mark the Accepted Answer? Sorry for the noob mistake.
Userlevel 7
Badge +13
Hi @red5! I have gone ahead and converted this discussion to a question! Be sure to respond Yes or No to the question "Did this completely answer your question?" on each comment! 🙂

Leave a Reply