How to change auto-advance by question/question response | XM Community
Skip to main content
Question

How to change auto-advance by question/question response

  • March 19, 2024
  • 11 replies
  • 389 views

Forum|alt.badge.img+8

How can I enable auto advance in the theme BUT disable on the last question/question block. 

I want people to be FORCED to answer a question but NOT autoadvance to close, after answer is submitted. Any javascript? Any HTML code? Or is there code for each block to autoadvance? Help!

Update to my question. 

If yes is selected here, I want to autoadvance to next screen/closing. If no is selected, I don’t want anything to happen. So how do I implement autoadvance on the whole survey BUT only one response for the last question?

 

 

11 replies

Forum|alt.badge.img+3
  • Level 2 ●●
  • 21 replies
  • March 20, 2024

Hi @MaggieGentry ,

You can use the below JS code which uses a change function. When Yes is selected it will auto advance and when no is selected nothing will get triggered.
NOTE: Assuming the YES option choice is always on 2nd position.

 

/*Place your JavaScript here to run when the page is fully displayed*/

    jQuery('.ChoiceStructure').find("input[type=radio]").eq(1).change(function() {
    var yes = jQuery(this).is(":checked");

    if (yes) {
      jQuery("#NextButton").click();
    }
});


Forum|alt.badge.img+8
  • Author
  • Level 2 ●●
  • 43 replies
  • March 21, 2024

 

@nikamshubham_73  I got an error message… here is what I added:

 

Qualtrics.SurveyEngine.addOnload(function()
{
    this.hideNextButton();
});

Qualtrics.SurveyEngine.addOnReady(function()
{
    /*Place your JavaScript here to run when the page is fully displayed*/

    jQuery('.ChoiceStructure').find("input[type=radio]").eq(1).change(function() {
    var yes = jQuery(this).is(":checked");

    if (yes) {
      jQuery("#NextButton").click();
    }
});


Forum|alt.badge.img+3
  • Level 2 ●●
  • 21 replies
  • March 21, 2024

Hi @MaggieGentry ,

The code you have provided is correct. However, there's a missing closing brace }) at the end of the code.


Forum|alt.badge.img+8
  • Author
  • Level 2 ●●
  • 43 replies
  • March 22, 2024

nikamshubham_73

Didn’t work/still autoadvanced when I hit no - any other thoughts?


Forum|alt.badge.img+3
  • Level 2 ●●
  • 21 replies
  • March 22, 2024

Hi @MaggieGentry ,

NOTE: Assuming the YES option choice is always on 2nd position.

I have used the below code and it working for me, please find link below for it
https://ugamsandbox.yul1.qualtrics.com/jfe/preview/previewId/e53967a1-4d8f-4170-8570-a97393907eb2/SV_1Ic9o4yIj1cKMzc?Q_CHL=preview&Q_SurveyVersionID=current
 

 


Forum|alt.badge.img+5

@nikamshubham_73 - I have autoadvance turned on for the whole survey. But when I click no, it still autoadvances. 

If yes is selected here, I want to autoadvance to next screen/closing. If no is selected, I don’t want anything to happen. So how do I implement autoadvance on the whole survey BUT only one response for the last question?


Forum|alt.badge.img+8
  • Author
  • Level 2 ●●
  • 43 replies
  • March 22, 2024

Oops - apparently I was in a rouge account. Reposting from my account! 

@nikamshubham_73 - I have autoadvance turned on for the whole survey. But when I click no, it still autoadvances. 

If yes is selected here, I want to autoadvance to next screen/closing. If no is selected, I don’t want anything to happen. So how do I implement autoadvance on the whole survey BUT only one response for the last question?


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • March 22, 2024

@MaggieGentry,

On the same page as your last question, add a text entry question after the last question and hide it with JavaScript.


Forum|alt.badge.img+8
  • Author
  • Level 2 ●●
  • 43 replies
  • March 25, 2024

@TomG  - That didn’t work - it still autoadvances to the next page (even though programmed on the same page - the theme is set to autoadvance on page and question)… where the question is hidden:

 

Is there a way to program the individual questions/pages to autadvance OR can I program autoadvanve NOT to occur on this last question if “no” is selected?


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • March 25, 2024

@MaggieGentry,

Based on your image, it did work since it didn’t automatically submit on the last page.  I think the issue is that you’ve set your survey to show 1 question per page, so you can’t add the hidden text entry question to the same page as the last question.

One more thing...I have a JS function that auto advances pages (autoAdvancePages) that can be turned on and off by block or page. Contact me by private message if interested.


Forum|alt.badge.img+8
  • Author
  • Level 2 ●●
  • 43 replies
  • March 25, 2024

I don’t have anything set for questions per page - other thoughts?

I have an idea to just change to “hard text” and have them hit submit - but this is different from the origininal