Deselecting a previously selected checkbox | XM Community
Skip to main content
Question

Deselecting a previously selected checkbox

  • June 26, 2023
  • 2 replies
  • 416 views

Forum|alt.badge.img+1

Hello and good morning! 

I’m wondering how I can set up so if I have a multiselect question with 9 answer choices but want to unselect a previously selected answer if the user selects more than 2 choices. 

Thanks in advance

-Anthony

2 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • June 26, 2023

How would you know which previous answer to unselect? I think a better solution would be to not let them select more than 2. They can deselect if they change their mind.


ArunDubey
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+41
  • QPN Level 8 ●●●●●●●●
  • June 30, 2023

I agree with @TomG , you should use Qualtrics property to fix the top 2 or upto 2 selection instead of auto uncheck of first selection. Sometime mouse click by mistake and that can change your actual response.

 

Else you can do this through JS.

First create runtime array using JS push() method to inseart selected option id. And if array length will reach at two and respondent will select additional checkbox. Then get the 0th index id and uncheck it from answer list and use pop() method to remove 0th index value and push() to add newly checked option into array.