How can I create just two text labels on either side of a slider bar. I am trying to replicate a previous study (Scroggs 1980) where the questions looked like this:
However, mine will be with a slider from 1-100.
Is there anyone who can help, I will appreciate any guidance!
Bella :)
Page 1 / 1
I have some code together in this post that can put labels on the right side of a slider.
Okay brilliant thank you, I will give that a go!
Unfortunately when I try to use this code it states “unexpected identifier”- I have provided an image to see if the issue can be identified.
Looks like a }); was deleted. Try updating the whole thing with the below:
Qualtrics.SurveyEngine.addOnload(function() { /*Place your JavaScript here to run when the page loads*/
});
Qualtrics.SurveyEngine.addOnReady(function() { /*Place your JavaScript here to run when the page is fully displayed*/ var qid = this.questionId; var end1 = document.getElementById(qid+'~1~result'); var cont1 = document.getElementById(qid+'~1~ResultsTd'); var end2 = document.getElementById(qid+'~2~result'); var cont2 = document.getElementById(qid+'~2~ResultsTd'); var end3 = document.getElementById(qid+'~3~result'); var cont3 = document.getElementById(qid+'~3~ResultsTd');
if (jQuery(window).width() > 480) { jQuery(cont1).css({"min-width":"130px"}); jQuery(cont2).css({"min-width":"130px"}); jQuery(cont3).css({"min-width":"130px"}); } });
Qualtrics.SurveyEngine.addOnUnload(function() { /*Place your JavaScript here to run when the page is unloaded*/
});
Ah I see! Apologies Friday brain! It has now accepted the code yet the actual sliders have not changed. Should I try and input my key terms into code?
If you preview the survey, do you see words on the right side of the first 3 sliders?
Ah ha it has partially worked! However for some reason the submissive did not input.
This is what my code looks like:
I presume I will only be able to see the end result in the preview of the survey?
Thank you for all your help!
Hmm, I’m not sure what you are running into, but I’d recommend making a new question and then use the Edit Multiple to set the Statements with the below:
Then, in the question’s JavaScript, add the below:
Qualtrics.SurveyEngine.addOnReady(function() { /*Place your JavaScript here to run when the page is fully displayed*/ var qid = this.questionId; var end1 = document.getElementById(qid+'~1~result'); var cont1 = document.getElementById(qid+'~1~ResultsTd'); var end2 = document.getElementById(qid+'~2~result'); var cont2 = document.getElementById(qid+'~2~ResultsTd'); var end3 = document.getElementById(qid+'~3~result'); var cont3 = document.getElementById(qid+'~3~ResultsTd'); var end4 = document.getElementById(qid+'~4~result'); var cont4 = document.getElementById(qid+'~4~ResultsTd'); var end5 = document.getElementById(qid+'~5~result'); var cont5 = document.getElementById(qid+'~5~ResultsTd'); var end6 = document.getElementById(qid+'~6~result'); var cont6 = document.getElementById(qid+'~6~ResultsTd'); var end7 = document.getElementById(qid+'~7~result'); var cont7 = document.getElementById(qid+'~7~ResultsTd'); var end8 = document.getElementById(qid+'~8~result'); var cont8 = document.getElementById(qid+'~8~ResultsTd'); var end9 = document.getElementById(qid+'~9~result'); var cont9 = document.getElementById(qid+'~9~ResultsTd'); var end10 = document.getElementById(qid+'~10~result'); var cont10 = document.getElementById(qid+'~10~ResultsTd'); var end11 = document.getElementById(qid+'~11~result'); var cont11 = document.getElementById(qid+'~11~ResultsTd'); var end12 = document.getElementById(qid+'~12~result'); var cont12 = document.getElementById(qid+'~12~ResultsTd'); var end13 = document.getElementById(qid+'~13~result'); var cont13 = document.getElementById(qid+'~13~ResultsTd'); var end14 = document.getElementById(qid+'~14~result'); var cont14 = document.getElementById(qid+'~14~ResultsTd'); var end15 = document.getElementById(qid+'~15~result'); var cont15 = document.getElementById(qid+'~15~ResultsTd');