How can I make my survey auto-advance using JavaScript so that after a person selects the answer to a question, it auto-advances to the next page?
Page 1 / 1
Assuming we are only talking about single punch multiple choice questions, you can use the following:
Qualtrics.SurveyEngine.addOnReady(function()
{
var that = this;
var answers = $$(".SingleAnswer");
for(var x = 0; x<answers.length;x++){
answers[x].observe('click', function(event) {
that.clickNextButton();
});
}
});
Qualtrics.SurveyEngine.addOnReady(function()
{
var that = this;
var answers = $$(".SingleAnswer");
for(var x = 0; x<answers.length;x++){
answers[x].observe('click', function(event) {
that.clickNextButton();
});
}
});
Thanks, @AnthonyR - this is close but doesn't exactly work for me.
I have multiple questions on the same page & only want the final question to auto-advance. When I use the JS above, it auto-advances when I select any answer. How can I specify the question I want to have this behavior?
I have multiple questions on the same page & only want the final question to auto-advance. When I use the JS above, it auto-advances when I select any answer. How can I specify the question I want to have this behavior?
You can use this code on the last question of the page:
Qualtrics.SurveyEngine.addOnload(function()
{
var that = this;
this.questionclick = function(event,element){
if (element.type == 'radio') {
that.clickNextButton();
}
}
});
Qualtrics.SurveyEngine.addOnload(function()
{
var that = this;
this.questionclick = function(event,element){
if (element.type == 'radio') {
that.clickNextButton();
}
}
});
> @AlexB said:
> You can use this code on the last question of the page:
>
> Qualtrics.SurveyEngine.addOnload(function()
> {
> var that = this;
> this.questionclick = function(event,element){
> if (element.type == 'radio') {
> that.clickNextButton();
> }
> }
>
>
> });
This should work perfectly, though honestly I warn against this functionality if you have multiple questions on a page. Respondents often times look at all the questions on a page and don't always answer in order. Auto-advancing may also lead to problems for respondents who accidentally clicked the wrong answer. When we attempted to do this, it was our number one complaint.
> You can use this code on the last question of the page:
>
> Qualtrics.SurveyEngine.addOnload(function()
> {
> var that = this;
> this.questionclick = function(event,element){
> if (element.type == 'radio') {
> that.clickNextButton();
> }
> }
>
>
> });
This should work perfectly, though honestly I warn against this functionality if you have multiple questions on a page. Respondents often times look at all the questions on a page and don't always answer in order. Auto-advancing may also lead to problems for respondents who accidentally clicked the wrong answer. When we attempted to do this, it was our number one complaint.
> @AlexB said:
> You can use this code on the last question of the page:
>
> Qualtrics.SurveyEngine.addOnload(function()
> {
> var that = this;
> this.questionclick = function(event,element){
> if (element.type == 'radio') {
> that.clickNextButton();
> }
> }
>
>
> });
Sorry, I'm a total noob, but where exactly would you embed this code in the question?
> You can use this code on the last question of the page:
>
> Qualtrics.SurveyEngine.addOnload(function()
> {
> var that = this;
> this.questionclick = function(event,element){
> if (element.type == 'radio') {
> that.clickNextButton();
> }
> }
>
>
> });
Sorry, I'm a total noob, but where exactly would you embed this code in the question?
click the gear icon on the left side, click "Add JavaScript" and paste the code in the box that pops up
Hi @AnthonyR - I have one slider question in place, do you know what changes I would need to make to the code above to have the survey auto-advance once the respondent has made their selection?
What is the best practice for when you want auto advance on your multiple choice questions but then you have a multiple choice that also allows text entry (e.g. an 'Other' category)?
I was thinking I would need an auto advance on all options other than the one that allows for text entry. Has anyone created code for this? My team is having trouble creating this in an efficient way.
I was thinking I would need an auto advance on all options other than the one that allows for text entry. Has anyone created code for this? My team is having trouble creating this in an efficient way.
How can you progress to the next page when the question type is not radio multiple choice? I have a multiple choice question but set up as a select box that gives a list of options (over 300+), but I can't figure out the question type for JS that will allow me to have users click an option and then be sent to the next page. Any ideas?
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.