Passing value of one question to another through Javascript | XM Community
Skip to main content

Hi,

I have a requirement to add NO RESPONSE option in a NPS question.

Since there was no standard feature to do it, I am trying to do the following:

1.I created a multiple choice question with scale of 0 to 10 and No response as options. This has NPS question label and this question is visible to user.

​​​​​​​2.In the next block, I added a standard NPS question and have hidden it. I have added the below Javascript code in this question:

 

3.I plan to use the hidden NPS question in reporting.

 

Below are the problems faced by me:

  1. The value doesn’t get assigned to the hidden question. But when I unhide the standard NPS question, I can see the values getting correctly assigned in case user has selected 0 to 10.
  2. In the case of NO RESPONSE, even with unhidden question, it doesn’t uncheck the previously selected value.
  3. I have not added ClickNextButton in code because in the block in which hidden question is present, there are other questions too. So the user would definitely click on Next button.

What am I missing ?

 

Regards,

Neha Tank

Be the first to reply!

Leave a Reply