Applying validation on Multi-select multi choice question | XM Community
Skip to main content
Solved

Applying validation on Multi-select multi choice question


Forum|alt.badge.img+4

Hi Team,

 

I have a multi-select multi-choice question in the select box type format along with the following JS embedded to enable search functionality in the text box

Qualtrics.SurveyEngine.addOnReady(function()
{
var options = {placeholder: 'Select an option'};
jQuery("#"+this.questionId).find('select:first').select2({options});
    

});

 

The option list also contain values like ‘No Active Disease’ and ‘I don’t know’ among 226 options. Therefore, I want to make other options un-selectable or show an error if other options are selected along with any of the above mentioned options. Is there a way to do the same using Javascript and can you please help me write the syntax for the same?   

Best answer by omkarkewat

Hi @Vinay_Bohra 
You can apply the following custom validation.
 

NOTE: It will also ensure that ‘No active disease’ and ‘I don’t know’ are not selected together.

 

View original

2 replies

Forum|alt.badge.img+20
  • QPN Level 5 ●●●●●
  • 290 replies
  • Answer
  • December 19, 2023

Hi @Vinay_Bohra 
You can apply the following custom validation.
 

NOTE: It will also ensure that ‘No active disease’ and ‘I don’t know’ are not selected together.

 


Forum|alt.badge.img+4
  • Author
  • QPN Level 2 ●●
  • 10 replies
  • December 19, 2023

@omkarkewat, it worked!