I've used the following code before to change the next button (from https://community.qualtrics.com/XMcommunity/discussion/426/change-next-forward-button-on-final-page-to-submit-finish-etc)
Qualtrics.SurveyEngine.addOnReady(function() {
var newName = 'Finish & Submit'; //Update - New Next Button label
var lastLoopOnly = true; //Last loop only? Value doesn't matter to non-loops
//No changes below
if(!lastLoopOnly || "${lm://CurrentLoopNumber}" == "${lm://TotalLoops}") {
var nb = jQuery('#NextButton');
nb.val(newName);
nb.attr('title', newName);
}
});
This time, however there are two versions of my survey.
- Version 1 has 4 questions
- Version 2 has 8 questions
I have embedded logic in the survey flow to identify when to show questions 5-8.
I am using the code above for the 8th question and that works great to show 'Finish & Submit". In the Look and Feel --> General, I have my Next Button Text as "Next", which works great for Version 2.
But I'd like the 4th question to show "Finish & Submit" in Version 1. I tried putting the code above in question 4, but it did not work as expected. It showed "Finish & Submit" for question 4 in Version 2.
I was thinking the looping logic would identify if it was the end of the survey and only show it at that point.
So my thoughts are
- Is it possible to have logic in the JavaScript to show the button as "Finish & Submit" based on my embedded data logic?
- Or maybe it's an issue with the type of QualtricsSurveyEngine? Should it not be .addOnReady?
- Or is there a different way to do the loop for it to identify the if the question is the last question?