Hello,
I have a multipart survey where, in Part 1, I ask people to divide 100 tasks between Part 2 and Part 3. I'm currently using a "Constant Sum" question:
I'd like to add some Javascript code that would do the following:
When a person clicks a bar, the other bar (e.g., the one not clicked) dynamically updates to the amount such that the total number of tasks between the two bars is 100. E.g., suppose a person clicked on the Part 2 bar at the value 57. Currently, this is what it shows:
Instead, I'd like the Part 3 bar to update automatically to 43. Similarly, if I clicked on, say, 80 on the Part 3 bar, I'd like the Part 2 bar to update to 20. And so on.
I know the following code captures the value of each bar (whenever someone clicks one of the two):
However, the code is missing two crucial elements. First, while I know how to capture/record the value when a bar is clicked, I don't know how to set a particular bar value. Second, the current code can only register if a person clicked either of the two bars. I need to differentiate which bar was clicked, so I know to change the other bar's value.
I feel like this is straightforward and must have been asked on the forum, but I can't seem to find it. Any tips/pointers are much appreciated!
-David
Dynamically Updating Bars on Constant Sum Question
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
