Loop & Merge block - How do I get "Submit" on the last Next Button? | XM Community
Skip to main content
Solved

Loop & Merge block - How do I get "Submit" on the last Next Button?

  • February 14, 2018
  • 3 replies
  • 47 views

Clint
Level 2 ●●
Forum|alt.badge.img+5
  • Level 2 ●●
  • 47 replies
When a survey ends in a Loop & Merge Block, how can I ensure that the very last Next button has the "Submit" text that I want? All other instances of the Next Button should just say "Next".

Best answer by TomG

You can write a JavaScript that checks if the piped in current loop number (lm://CurrentLoopNumber) is equal to the piped in total loops (lm://TotalLoops). If it is, change the NextButton value and title attribute. I would post the code, but I get an "Access Denied" error when I try.

3 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • Answer
  • February 15, 2018
You can write a JavaScript that checks if the piped in current loop number (lm://CurrentLoopNumber) is equal to the piped in total loops (lm://TotalLoops). If it is, change the NextButton value and title attribute. I would post the code, but I get an "Access Denied" error when I try.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • February 15, 2018
On second thought...the JavaScript is in the attached file. Sorry I can't post it.

Clint
Level 2 ●●
Forum|alt.badge.img+5
  • Author
  • Level 2 ●●
  • 47 replies
  • February 15, 2018
> @TomG said: > You can write a JavaScript that checks if the piped in current loop number (lm://CurrentLoopNumber) is equal to the piped in total loops (lm://TotalLoops). If it is, change the NextButton value and title attribute. I would post the code, but I get an "Access Denied" error when I try. I dig it. I'm always looking for a more "out of the box" solution, but checking against total loops works. Going to play around with some JS today or tomorrow.