Community Groups are officially here!
We've released Groups, a new feature that enables us to connect community members of similar industries and interests in a shared, private space. You can check out all of the details here, including information about who can join, how to join, and what Groups are currently offered. Please leave your feedback through this Community Groups Feedback Survey.

this.getChoiceAnswerValue(); not a function???

Pete_L
Pete_L Community Member, Qualtrics Brand Admin Qubie ✭

I am playing around in prep for developing a soft-prompt in Qualtrics (because they do not have a feature for one) and I ran into a situation where the console is telling me 'this.getChoiceAnswerValue' is not a function.

  1. I've hidden the 'NEXT' button and replaced it with a fake one
  2. On click I am trying to have Qualtrics check answers on the question.
  3. If the answer(s) are length of 0, flag the question as empty.)

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

/*Create the fakeNext button, copy NextButton styling, and then hide the NextButton*/
jQuery("#NextButton").after("<button type='button' class='NextButton Button' id='fakeNext' value='NEXT' title='NEXT' aria-label='NEXT'>NEXT</button>");
jQuery('#fakeNext').copyCSS('#NextButton'); 
jQuery("#NextButton").hide();

var empty = 0;

jQuery('#fakeNext').click(function(){
     var answers = this.getChoiceAnswerValue();
     console.log("Answers = " + answers);
     if(answers.length=0){
         empty = 1;
     } else {
         empty = 0;
     }
     console.log("Empty flag = " + empty);

});

});`

Is it not possible to use this.getChoiceAnswerValue(); at this point? Do I have something silly hiding in there that's messing me up?

Tagged: