Enabling Button not working as intended | XM Community
Solved

Enabling Button not working as intended

  • 26 October 2018
  • 2 replies
  • 33 views

Hello everyone,

I am new here, so please bare with me if my format is wrong.

Here is what's going on. I have a custom next button using JS. After clicking on custom next button twice, it will have a popup asking user to confirm. What I want is, if the user is sure, then I can record what his answer was (as an embedded data field) and go on to the next question.

However, a weird problem occurred, I can only record the user choice but cannot let it automatically go on to the next page.

Here is the code inside addOnload function.

if(buttonStatus){
if(confirm('Are you saying that if I offer you $' + (parseInt(confirmFinal())+1) + ', you will take it and not take the gamble? And if I offer you $'+ (parseInt(confirmFinal())-1) + ', you would take the gamble for sure?')) {

this.clickNextButton();

Qualtrics.SurveyEngine.setEmbeddedData('userChoice1', confirmFinal() );

return;
}
else{

resetCells();

buttonStatus = false;

return;


}
}


I also used Qualtrics.SurveyEngine.clickNextButton() and didn't work.
icon

Best answer by NiC 26 October 2018, 20:31

View original

2 replies

Userlevel 7
Badge +27
replace` this.clickNextButton();`
with `jQuery("#NextButton").click() ;`
Thank you!

Leave a Reply