conditional last-block submit button | XM Community
Solved

conditional last-block submit button

  • 31 July 2020
  • 3 replies
  • 29 views

Userlevel 2
Badge +6

I'm building a survey that has three separate question blocks and logic to display one, two, or all three of them, depending on embedded data passed in at the beginning. If multiple blocks appear for a respondent, they are always in the same order.
I'm looking for a way to do something like:
IF: this is the last block in the survey that the respondent will see, change the submit button to "Submit".
ELSE: keep it as an arrow.
Any suggestions for how to pull this off? I found a couple of questions about conditional buttons based on question choice, but that seemed too far off the mark.

Thank you!

icon

Best answer by rondev 31 July 2020, 20:05

View original

3 replies

Userlevel 2
Badge +6

I should note that the case in which all three are displayed has been solved, because I've just hardcoded the button in the last block. It's the one and two-block cases that I can't seem to figure out.

Userlevel 7
Badge +22

We need to change the next button text using java script.
Apply if logic on the embedded data, and based on the value, change the button text using below code:
jQuery("#NextButton").attr({"value":"Submit","title":"Submit"});

Userlevel 2
Badge +6

perfect! thank you, rondev

Leave a Reply