Record text entry response on page submit | XM Community
Skip to main content

Hello,

 

I have a text entry (numeric) question that loops 4 times. I want to record the response of the 2nd loop as an embedded data field to be used in a later part of the survey. I am currently using the following code in js, but it is not working. Any thoughts on how to get the code to work?

 

Qualtrics.SurveyEngine.addOnPageSubmit(function() { 
    
    if("${lm://CurrentLoopNumber}" == 2) {
        var res_beliefdays = jQuery("#" + this.questionId + " .InputText").val();
         Qualtrics.SurveyEngine.setEmbeddedData("res_beliefdays",res_beliefdays);
    
    }

});

    

@pb7 Your code run fine with all Layout except Simple Layout! If you’re using Simple Layout, use the other one.


Thanks @Nam Nguyen ! 

I am using the Classic layout.. it does not seem to be working on that either..

res_beliefdays is defined as a numeric variable in the survey flow. Should I use a parseInt somewhere?

thanks for your help!


Leave a Reply