Show next button only if an answer is selected | XM Community
Skip to main content

Show next button only if an answer is selected

  • January 12, 2023
  • 4 replies
  • 221 views

Forum|alt.badge.img+1

hello mates
need your help
i have a simple multiple choice question with only one checkbox
I would like to show the next button only if this checkbox is selected
Is there a way?

4 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • January 12, 2023

Add this JS to your question:
Qualtrics.SurveyEngine.addOnReady(function() {
var qobj = this;
qobj.hideNextButton();
jQuery("#"+qobj.questionId+" [type=checkbox]").click(function() {
if(this.checked) qobj.showNextButton();
else qobj.hideNextButton();
});
});


Forum|alt.badge.img+1
  • Author
  • 8 replies
  • January 12, 2023

it works thanks a lot


Forum|alt.badge.img
  • 1 reply
  • February 29, 2024

Hello Mates, 

Unfortunately, the "Next" button disappears if I use this code, but after I have completed a questions the ‘NEXT Button’ does not reappear. Could you please provide guidance on how to resolve this?

 


 

 


Forum|alt.badge.img+3

Hi @csnagy,

→ The next button is initially hidden in the above code, that’s why it is disappeared.

→ You must have declared it globally at the start of the code due to which the next button is disappeared for all the questions. Enter the JS in between the element of the following, it will only work  for the particular question and not the whole survey.
 

Qualtrics.SurveyEngine.addOnReady(function()
{

    Your JS Code
});


Leave a Reply