I've lost hours by trying to implementing javascript code that auto-advances to next question once any choice was made on a single-choice question. I've found several code-snippets like
var qobj = this;
jQuery("#"+this.questionId+" input[choiceid=1]").click(function() { qobj.clickNextButton(); });
jQuery("#"+this.questionId+" input[choiceid=2]").click(function() { qobj.clickNextButton(); });
jQuery("#"+this.questionId+" input[choiceid=3]").click(function() { qobj.clickNextButton(); });
or this (very generic) one:
jQuery("td").click(function(){
setTimeout(function() {
jQuery("#NextButton").click();
}, 10);
});
Both snippets are working: if a participant clicks an answer, he is moved to the next question.
But as soon as another single-choice question is in line in the survey flow, this question seems to be affected by the automatism as well and gets immediately "skipped" without having time to make a choice!
Any help on this is desperately appreciated!
Javascript issue: how to auto-advance once any choice was made in single-choice question
Best answer by novern
I managed it by using this code
Qualtrics.SurveyEngine.addOnReady(function() {
/*Place your JavaScript here to run when the page is fully displayed*/
var that = this;
var answers = $$(".SingleAnswer");
for (var x = 0; x < answers.length; x++) {
answers[x].observe('click', function(event) {
that.clickNextButton();
});
}
in addition to a timed 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.
