Tagging progress bar to questions rather than pages | XM Community
Skip to main content

Tagging progress bar to questions rather than pages

  • May 5, 2022
  • 1 reply
  • 91 views

Hello!!
How can we make the progress bar work when the respondents answer the questions in a single page. In my case, the progress bar moves when I click the next page.
I am new to the tool, please help if this functionality is already present in the tool
Thanks in advance!!

1 reply

Tom_1842
Level 8 ●●●●●●●●
Forum|alt.badge.img+28
  • Level 8 ●●●●●●●●
  • May 5, 2022

Hi there, try adding the below to the Onload section of each question's JavaScript on your page:
var QID = this.questionId ;
jQuery("#" + QID + " input:not([type=image]").on("click", function() {

jQuery("div.ProgressBarFill").css("width", assignedprogress+"%");

});
When the question is clicked, the Progress Bar will update to whatever value you put in the "assignedprogress" piece of that code. Update the "assignedprogress" value for each question.
I used the "input:not([type=image]" so that it should work for most question types unless the respondent is clicking on image. Other selectors can be found below.
https://community.qualtrics.com/XMcommunity/discussion/5187/change-value-of-the-progress-bar
https://stackoverflow.com/questions/5982508/is-there-an-or-attribute-selector-like-inputtype-buttontext