I have a question with a set of retailers. If I selected Walmart, Costco and Amazon, how can I pipe them to a question with the 'and' added to it?
Walmart, Costco and Amazon
If I use SelectedChoices, it separates everything by a comma.
Page 1 / 1
In the question text html view wrap the pipe text with span tag and give a class attribute to it as shown below:
${q://QID509/ChoiceGroup/SelectedChoices}
In the javascript of this question where we are displaying the pipe text, paste the below code:
jQuery(".pipetext").text(jQuery(".pipetext").text().replace(/,([^,]*)$/, " and" + '$1') );
Thanks!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.