Get Answer from Side-by-side in javascript | XM Community
Skip to main content
Solved

Get Answer from Side-by-side in javascript

  • June 3, 2020
  • 2 replies
  • 62 views

Hi,
suppose that I have a single side-by-side question, where subjects can decide between Option A and B. How would I get their selection ("A" or "B") as a string into my javascript?
(What I had so far, were only text entry questions, on which i used var answer1= parseInt("${q://QID17/ChoiceTextEntryValue} ");)
Thanks for your help,
Sabrina

Best answer by TomG

Assuming you are referring to the first column of the side-by-side it would be:
${q://QIDXX%231/ChoiceGroup/SelectedChoicesForAnswer/1}
The easiest way to get the correct pipe string is to click on Question Text and use the Piped Text menu.

2 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • June 3, 2020

Assuming you are referring to the first column of the side-by-side it would be:
${q://QIDXX%231/ChoiceGroup/SelectedChoicesForAnswer/1}
The easiest way to get the correct pipe string is to click on Question Text and use the Piped Text menu.


  • Author
  • June 4, 2020

Thanks Tom, that's what I was looking for :)