I switched a survey over to the “New Survey Experience.” In the prior survey version, the javascript that I used in the question to create an embedded variable works as expected. I’ve included the query below. When I switched to the “New Survey Experience” the embedded variable is no longer being created and I get the following errors in the console: “Error executing custom js: ReferenceError: o is not defined” and “Listener must be a named function”.
Does the “New Survey Experience” require doing something additional to make jQuery work?
Qualtrics.SurveyEngine.addOnPageSubmit(function() {
var essayText = jQuery("#" + this.questionId + " .InputText").val();
var htmlText = essayText.replace(/\n/g, "<br>");
Qualtrics.SurveyEngine.setEmbeddedData("FormattedResp", htmlText);
});