Hi @DashaG ,
Did you change the QID number to fit your situation?
I placed the following JavaScript code, from the thread you mentioned, into question QID36 (item 1)’s Add JavaScript. Then, question QID37 (Item 2) having in-page display.
It is working, where the next button is hidden when Item 2 is not displayed.
Qualtrics.SurveyEngine.addOnReady(function()
{
jQuery("#NextButton").hide();
jQuery(".JFE").on("mouseover change click", function(){
jQuery("#NextButton").hide();
/*Change QID37 to your question*/
if (jQuery("#QID37").is(":visible")){
jQuery("#NextButton").show();
}else{
jQuery("#NextButton").hide();
}})}
);
If it still doesn’t work on your end, perhaps you might be using New Survey Experience.
Simple layout would be something like this :
Qualtrics.SurveyEngine.addOnReady(function () {
var nextButton = document.getElementById("next-button");
if (nextButton) nextButton.style.display = "none";
var pages = document.querySelectorAll("#page");
pages.forEach(function (el) {
["mouseover", "change", "click"].forEach(function (evtType) {
el.addEventListener(evtType, function () {
if (nextButton) nextButton.style.display = "none";
var qid2 = document.getElementById("question-QID2");
if (qid2 && qid2.offsetParent !== null) {
nextButton.style.display = "flex";
}
});
});
});
});