conditional last-block submit button

jpmorganjpmorgan New YorkCommunity Member Qubie ✭
edited July 31 in Custom Code

conditional last-block submit button

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!

Best Answer

  • rondevrondev Community Member - Trial User Wizard ✭✭✭✭✭
    Accepted Answer

    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:



  • jpmorganjpmorgan New YorkCommunity Member Qubie ✭

    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.

  • jpmorganjpmorgan New YorkCommunity Member Qubie ✭

    perfect! thank you, @rondev

Sign In to Comment