I need a code that can allow survey participants to deselect their clicked selection | XM Community
Skip to main content

I need a code that can allow survey participants to deselect their clicked selection


Forum|alt.badge.img+5

Hello XM Community,
I'm wondering if there's a code that I can add in order to enable survey respondents to deselect their clicked selection when responding to the survey questions.

Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+43
  • October 3, 2022

sajjid
Are you looking for select all / deselect all kind off button.
Have a look at this thread:
Check/Uncheck Button — Qualtrics Community
Hope this helps!


Forum|alt.badge.img+5
  • Level 1 ●
  • October 3, 2022

Yes, deselect specifically. And also, I'm wondering if the code can work in a matrix table. I tried the check/uncheck button code that you provided, which is working well in a multiple choice question but not working in a matrix-type question.


Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+43
  • October 4, 2022

sajjid
Yes, it is for a multiple choice question. Within matrix are you working on multi-answer or single-answer per row?


Forum|alt.badge.img+5
  • Level 1 ●
  • October 4, 2022

single-answer per row


Forum|alt.badge.img+5
  • Level 1 ●
  • October 4, 2022

Here's a screenshot. For each row, the participant is expected to select only one of the many provided measurement scales.
image.png


Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+43
  • October 5, 2022

sajjid
It took some time to figure out but here it is (Include in your HTML):



Hope it helps!


Forum|alt.badge.img+5
  • Level 1 ●
  • October 5, 2022

thanks a lot, Deepak ! It worked flawlessly. I also figured out that I need to add/edit codes if I make any changes to the choices or the measurement scales. This is awesome! Thanks a bunch!!


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • October 5, 2022

Forum|alt.badge.img+5
  • Level 1 ●
  • October 5, 2022

TomG , this is super nifty! thank you!!


SuhasM
Qualtrics Employee
Forum|alt.badge.img+16
  • Qualtrics Employee
  • October 6, 2022

Once again, Deepak and TomG have tag-teamed to provide a genius custom code solution! 🤝 You guys went above and beyond to help sajjid 🙂


JonesE
Level 4 ●●●●
Forum|alt.badge.img+22
  • Level 4 ●●●●
  • April 1, 2024

Hi! I’m trying this on a side by side question type, but it’s not working. I don’t see anywhere in the code provided by @TomG that specifies the quesiton type (matrix versus side by side), but is there any reason why this wouldn’t work on a side by side question? Thanks! 

 

PS - Side by side questions are annoying and I hate them.


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • April 1, 2024

It doesn’t work because the setChoiceValue() function doesn’t work on side-by-side questions.

Deselecting radio buttons in a side-by-side question is quite tricky. If you are interested, I have a function that does it: uncheckRadios (not compatible Simple layout)


Leave a Reply