Hello,
I would like to use loop and merge function in block with just one slider. The participant has to select number specified in loop and merge field "Select the number ${lm://Field/1} ". In these fields I have random number generator (${rand://int/1:100}). Is there a way, to validate, that participant selected the presented number? If yes, he/she can continue to next loop, if not, he/she can't continue or there is no next button. I was searching for answer, but I can't find solution. Thank you very much.
Solved
Is there a way to hide next button until slider value is equal to loop&merge field number?
Best answer by ahmedA
This was quite an interesting question. Add this to your JS:
Qualtrics.SurveyEngine.addOnReady(function () {
let quest = this,
ip = quest.questionContainer.querySelector(".ResultsInput"),
val = "${lm://Field/1}",
nb = document.querySelector("#NextButton");
nb.hide();
ip.onchange = function () {
if (ip.value == val) nb.show();
else nb.hide();
};
});
However, if this is an attention test, I think its a bit too difficult. Demo
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
