Change question text using JS | XM Community
Skip to main content
Hi there,



I've got a very large survey that allows respondents to miss questions out within a block, and return to them later.

I'd like to have a descriptive text question at the end of each block that lists the questions which have not been completed (this is preferable to a pop-up msg)



Currently, this is built with 5 other questions, each highlighting a missing mandatory entry, and uses display logic to show the respondent the appropriate ones.



This happens at 10 different points within the survey (one for each block). There has to be a better way of doing this with JS that would allow it to happen all within one question per block, rather than have 50 questions to do this job!



Am a newbie to JS, but keen to compile it myself - Could someone give me a nudge in the right direction, or let me know which functions would be most helpful?



I'm assuming it has to look something like this:

IF (question 1 is blank) then { "you need to answer question 1" }

ELSE {}
1. Qualtrics Piped Text

2. JavaScript Objects

3. jQuery.each()

4. jQuery.html()

Leave a Reply