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

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


Userlevel 1
Badge +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.


12 replies

Userlevel 7
Badge +36

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!

Userlevel 1
Badge +5

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.

Userlevel 7
Badge +36

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

Userlevel 1
Badge +5

single-answer per row

Userlevel 1
Badge +5

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

Userlevel 7
Badge +36

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



Hope it helps!

Userlevel 1
Badge +5

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!!

Userlevel 7
Badge +27

Here is a more flexible and concise method to reset a matrix:
Qualtrics: Reset Likert Matrix. Works with single or mult-select matrix. Add button html to question text. #qualtrics #js #jq #matrix #likert #reset

Userlevel 1
Badge +5

TomG , this is super nifty! thank you!!

Userlevel 4
Badge +16

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

Userlevel 4
Badge +22

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.

Userlevel 7
Badge +27

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