Change value of the progress bar | XM Community
Solved

Change value of the progress bar


Is it possible to change the value of the built in progress bar with a simple javascript code?
The current %-values of my survey give a wrong impression about the length, so I'd like to assign my own values.
icon

Best answer by TomG 3 July 2019, 16:30

View original

11 replies

Userlevel 7
Badge +27
Yes, if assignedProgress is a number representing the current progress:
```
jQuery("div.ProgressBarFill").css("width", assignedProgress+"%");
```
Thanks a lot. Works perfectly.
Badge +5
So this would provide a value to the progress? Like 65%? And where would I enter this javascript to make this happen? Thanks!
Userlevel 7
Badge +27
> @djunius said:
> So this would provide a value to the progress? Like 65%? And where would I enter this javascript to make this happen? Thanks!

It would set the progress bar fill amount. You would add the JS to the addOnReady function in any question on the page or to a script in the header or footer.
Userlevel 1
Badge +3

Change value of the progress barWorked great.. Thanks..

So, for some reason I had a problem with that code and couldn't get it work. This one worked right away for me:
jQuery("div.ProgressBarFill").css("width", "80%");

Hi, I want to change the number on the progress bar of some pages manually. The code on the comment above works perfectly on moving the bar to represent, for example 80% progress, but I would like the number to update too. I have the following code on the look and feel header, that shows the number on the progress bar e.g. 80% progress.
Qualtrics.SurveyEngine.addOnReady(function() { 

jQuery("table.ProgressBarContainer tbody tr td:eq(0) label").text(jQuery("#ProgressBarFillContainer span").text()); });


Does anyone know how to adjust the code below so that the number would update too?
jQuery("div.ProgressBarFill").css("width", "80%");
Thank you!

Badge

https://community.qualtrics.com/XMcommunity/discussion/comment/15489#Comment_15489where I input this code?

Badge +1

Is there a way for the progress bar to update as questions are completed I.E - I have 53 questions, when someone has completed 10, how do I get the progress bar to show 10/53 aka 19% complete?

Userlevel 7
Badge +27

https://community.qualtrics.com/XMcommunity/discussion/comment/45533#Comment_45533You would need to keep the question count in an embedded variable and update it on each page. 'assignedProcess' would be your embedded variable divided by 53.

Badge +1

TomG done thru adding code? any additional advice would be greatly appreciated!

Leave a Reply