How to disable/freeze a slider? | XM Community
Skip to main content

Does anyone know how to disable/freeze a slider using javascript?

I am trying to make a survey with slider where people can go back and forth but would not be able to adjust their previous choices with sliders.

I would like to do something similar but have not found a solution yet. Would really appreciate it if anyone could help!
@TomG would you be able to help with this? Thank you so much!


chu_2024 I actually figured out a solution:

  • you create an embedded data to flag if the participant has submitted a response to the slider

  • check on load using this embedded data to determine if we want to disable the slider

Qualtrics.SurveyEngine.addOnReady(function(){
var flag = parseInt("${e://Field/flag}");

if(flag==1){
jQuery("#"+this.questionId).css("pointer-events", "none");
};
});


Qualtrics.SurveyEngine.addOnPageSubmit(function(type)
{
if(type == "next")
{
Qualtrics.SurveyEngine.setEmbeddedData("flag", "1");
};
});


Note that this way of disabling is not perfect - you can still use "Tab" key to select the slider and move it with left and right arrow keys.


Leave a Reply