Dear Community,
Is there any way I can make sure that until a respondent clicks on a button within a text/graphic box, they cannot proceed to the next question? Right now, using the timer question, I can validate later based on clicks, but that is not efficient.
For example, until they click "Conference room with a view" in the text box "Scenario", they cannot proceed to Q25.
Vipul
You can include a javascript to disable the Next Button and only enable it when the link is clicked. You can keep all the other questions on next pages.
Qualtrics.SurveyEngine.addOnReady(function()
{
jQuery('#NextButton').prop("disabled", true);
/*Place your JavaScript here to run when the page is fully displayed*/
jQuery('a').eq(0).click(function(){
jQuery('#NextButton').prop("disabled", false);
})
});
Hope it helps!
Deepak,
Thank you for your suggestion. This works if I don't use the timer question in parallel. Do you happen to know how I can make it work with the timer question too?
My current code:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
});
Qualtrics.SurveyEngine.addOnReady(function()
{
jQuery('#NextButton').prop("disabled", true);
jQuery('a').eq(0).click(function(){
/*Place your JavaScript here to run when the page is fully displayed*/
jQuery('#roomOpen').on('click', function(){ jQuery('#room').show() });
jQuery('#roomClose').on('click', function(){ jQuery('#room').hide() });
jQuery('#NextButton').prop("disabled", false);
})
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
I am loading a website under that box so that the user can open the link and it opens up in a box. The problem is since I am delaying the next button using a timer, it will still show up irrespective of if I opened the link or not.
https://community.qualtrics.com/XMcommunity/discussion/comment/52233#Comment_52233You can remove the timing question as it will interfere with the code and delay the next button to show after a specific number of seconds in JS. Something like this, I have delayed it by 3 seconds you can change that.
Qualtrics.SurveyEngine.addOnReady(function()
{
jQuery('#NextButton').prop("disabled", true);
/*Place your JavaScript here to run when the page is fully displayed*/
jQuery('a').eq(0).click(function(){
setTimeout(function(){
jQuery('#NextButton').prop("disabled", false)
},3000);
})
});
Hope it helps!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.