I have a survey and I want to show participants their responses for review before submitting. These are all multiple selection items. By default, the piped responses come in separated by a comma (selection1, selection2, selection3). I would like to instead put these each on a new line. They are all being brought in to a descriptive text element. I wrapped the descriptive text in a <span> with an id=ReviewWrapper and then added the JS below. Rather than replacing the commas, it is replacing the entire descriptive text with /,/g. I can't for the life of me figure out why. Relatively new to JS and this is one of my first attempts at implementing JS in Qualtrics. Any help is greatly appreciated.
> Qualtrics.SurveyEngine.addOnload(function()
> {
> var pipedText = $('ReviewWrapper');
> console.log(pipedText);
> pipedText.replace(new RegExp(",", 'g'), '/n');
> console.log(pipedText);
> });
icon
Best answer by Matt_Christie_Walker 27 April 2018, 16:43
View original