"Answer a few more questions" and "Be done" buttons on multi-page survey? | XM Community
Question

"Answer a few more questions" and "Be done" buttons on multi-page survey?


Userlevel 1
Badge +4

We have a survey with two pages, where the first page has the questions we need everybody to answer and the second page has some extra “nice to have” questions. Instead of the “Next” button at the end of the first page (block), I would like to give respondents the option to either submit now (which would skip to the Thank You page and log the response as “Submitted”) or go to the next page and answer the other questions.

Right now the only option I see is to ask a question at the bottom of the first page (“Do you have time to answer a few more questions?”) and then go to the next page or submit depending on their answer, but that would add an extra, unnecessary click to the process.

Can I either add some fancy CSS and/or JS to add a second button to the block? Or can I remove/hide the button at the end of the block and take action (next page or submit) directly from the “Do you have time” question?

Thanks- Marc


5 replies

Userlevel 6
Badge +27

Yes we can hide the next button and take next button action based on last using the below code. Paste the below code in the JS (addOnReady) of last question: 

this.hideNextButton();	
jQuery("#"+this.questionId+" input[type='radio']").on("click change",function(){
jQuery("#NextButton").click();
});

 

Userlevel 1
Badge +4

Yes we can hide the next button and take next button action based on last using the below code. Paste the below code in the JS (addOnReady) of last question: 

this.hideNextButton();	
jQuery("#"+this.questionId+" input[type='radio']").on("click change",function(){
jQuery("#NextButton").click();
});

 

Thanks, Shashi! That worked great to hide the button, but do you know how I can get the last question to “submit” the page when an answer is clicked?

I have the survey flow set to end/continue based on the answer, but not sure how to get it to go.

 

Userlevel 6
Badge +27

I think this response may help 

 

Userlevel 1
Badge +4

The issue I seem to be having with the code is that nothing in the “if (element.type == 'radio')” section is working. I tried just adding a simple alert inside there and it wouldn’t show up (but outside the “if” works fine). I then created an alert to tell me what the element.type is, but that comes back as “undefined.”

Did something change? I even tried a sample direct from the API docs (https://api.qualtrics.com/82bd4d5c331f1-qualtrics-java-script-question-api-class) but can’t get it to work. I’ve triple-checked that I’m using the right question (Multiple Choice, Allow One Answer).

Thanks- Marc

Userlevel 7
Badge +33

See, you can create the same question "Do you have time to answer a few more questions?" As mentioned above in your comment, but keep it hide with next button via js.

 

Then create 2 new HTML buttons with text "Next" and "Finish survey". While clicking on Next html button, punch Yes  in "Do you have time to answer a few more questions?" Question and also click on hidden default next button of Qualtrics.

When clicking on "Finish survey" html button, punch No  in "Do you have time to answer a few more questions?" Question and click on hidden next button of Qualtrics.

 

Apply next page/block display logic based on "Do you have time to answer a few more questions?" =Yes.

Leave a Reply