Auto advance on first question with preselected answer | XM Community
Skip to main content

Hello, I have a single page survey which is accessed by users via an URL which is passing the first answer to the survey. Therefore, users always arrive on the survey with the first answer pre-selected. However, the auto-advance feature does not advance to the next question for some reason. Is there JS code I can add or some other workaround to always auto advance to the second question?

@genik88 Add this Java Script to your fist question, it will automatically click the next button for you

Qualtrics.SurveyEngine.addOnReady(function()
{
this.clickNextButton();
});

Let me know if it helps


this code provided by Dxconnamnguyen should work.


Thank you! Is there a variation of the code that could only move to 2nd question if the first question has a response pre-selected? 


Thank you! Is there a variation of the code that could only move to 2nd question if the first question has a response pre-selected? 

You can use this to check for the answer embedded data field

Qualtrics.SurveyEngine.addOnReady(function()
{
var Q1ans = "${e://Field/Q1answer}";
if (Q1ans.length !== 0) {
this.clickNextButton();
}
});

Change ${e://Field/Q1answer} to your embedded data field


When I added this script it it started always auto scrolling to second question and wouldnt even allow to manually scroll back up and other questions would be flashing purple


I think the issue is that the clickNextButton tries to click the “Submit” button. I just want the page to scroll to the second question which is on the same page.


I think the issue is that the clickNextButton tries to click the “Submit” button. I just want the page to scroll to the second question which is on the same page.

Got it, how do you pre-selecting your Q1 right now? Try switching to button click and it will trigger the auto-advance as normal.

For example

If you’re using

this.setChoiceValueByRecodeValue(2,'true');

switch to

jQuery("#QID80-2-label").click();

change the QID to your


The Q1 response is passed via Q_Populate in the URL to access the survey


The Q1 response is passed via Q_Populate in the URL to access the survey

Yes, what code you’re using for Q1?. Change it to the click action to trigger auto advance

 


Leave a Reply