How can I get auto-advance to the next page when participant starts the survey through email? | XM Community
Question

How can I get auto-advance to the next page when participant starts the survey through email?

  • 17 September 2019
  • 9 replies
  • 494 views

I am using javascript code that will auto-advance on click when a participant clicks an answer, but the issue is when a participant answers the first question in their email, it will take them to the first page of the survey with their answer choice pre-populated, but does not automatically advance to the next page. Any suggestions for code that would essentially check if an answer is chosen and then advance? Using a timer won't work in this case, because some participants may access the survey through a link and therefore not have the first answer pre-populated.

Here is the code I have been using for the on-click solution:
Qualtrics.SurveyEngine.addOnload(function()
{
var that = this;
this.questionclick = function(event,element){
if (element.type == 'radio') {
that.clickNextButton();
}
}
});

Thanks!

9 replies

Userlevel 7
Badge +11
You can use a timer question set to .1 seconds to auto-advance after they've clicked the inline question.

More info in this thread.
Userlevel 7
Badge +11
Ah, I see I missed the part that you said where some respondents won't have answered the first question. Can you add display logic to the timer question that only shows if the inline question is not blank?
No worries, JenCX, thanks for following up! We the same idea! Unfortunately, it did not work properly, but we are not sure why. We have it set up to display the timer question if a person selects one of the choices, but have had no success with getting that to work. However, if you have additional suggestions we can try doing it in another way.
Userlevel 7
Badge +27
Change addOnload to addOnReady and add this as the first line of your JS:
```
if(jQuery("input[type=radio]").is(":checked").length > 0) this.clickNextButton();
```
P.S. If you have the back button enabled, you should hide it on the next page.

TomG - For some reason the code you suggested above is not working for me. I have a radio button question with two choices inserted as inline question, but when clicked from the email, it open up the same page with the option highlighted. Can you help?

Userlevel 7
Badge +27

https://www.qualtrics.com/community/discussion/comment/32874#Comment_32874Try it like this:
if(jQuery("input[type=radio]:checked").length > 0) this.clickNextButton();

Perfect TomG That works wonderfully even-though with a small micro second delay to auto forward from inline question to next page 🙂 I think I can still live with that :)
Now i need to figure out how to disable back button only on my next page. Is it a JS I have to use? as my next page is a block with two questions.

Hi TomG I think i figured it out. I used a branching in survey flow where all blocks are displayed only if the inline question is answered. Thank you so much for your help.

Userlevel 7
Badge +27

You don't have to worry about the Next button if the next question is in another block with survey flow element (e.g., branching) in between.

Leave a Reply