Hello.
Apologies if i have missed this answer elsewhere.
I have a slider, and I want to dynamically update the difference between player 1 and player 2's income as a function of the quantity player 1 gives to player 2 (this quantity is chosen by using the slider).
The below runs fine on a desktop, and works fine in the 'mobile view' when I preview the survey on a desktop. However it does not update when I view the preview on a mobile, nor when I publish and view on a mobile.
Any tips re. getting this to work on a mobile would be much appreciated :)
Qualtrics.SurveyEngine.addOnload(function() {
var give=0;
var give2 = give*2;
var final_difference = 0;
var inc="${e://Field/income_final}";
var partner_inc = "${lm://Field/1}";
this.questionclick = function(event,element){
give = this.getChoiceValue(1);
give2 = give*2;
final_difference = "${e://Field/income_final}" - give - "${lm://Field/1}" - give2 ;
inc = "${e://Field/income_final}" - give;
partner_inc = "${lm://Field/1}" + give2
endupdate();
document.getElementById("final_difference").innerHTML=final_difference;
document.getElementById("give2").innerHTML=give2;
document.getElementById("give").innerHTML=give;
document.getElementById("inc").innerHTML=inc;
document.getElementById("partner_inc").innerHTML=partner_inc;
}
function endupdate() {
give = give;
give2 = give*2;
final_difference = final_difference;
inc = inc;
partner_inc = partner_inc;
}
});
this.questionclick not working in mobile view
Best answer by Tom_1842
Hi there, ahmedA recommends trying "oninput" in the below thread:
https://community.qualtrics.com/XMcommunity/discussion/19125/check-value-of-dropdown-with-javascript
I've also used "touchstart" with sliders in a different thread with success:
https://community.qualtrics.com/XMcommunity/discussion/19690/change-the-slider-question-clickable-buttons-to-be-a-different-color-for-first-position-only
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.
