Validation on Likert type of question | XM Community
Skip to main content

Hi All,

 

I have a likert type question in my survey having 5 statements and 7 scale points for each statement. I wanted to apply a validation, where a respondee need to select at least one statement and at max 3 statement. 

I checked, and it is not possible via direct validations. Is it possible to write a javascript for the same? If yes, then how we can do it? 

@Vinay_Bohra - You can add a text entry question to the same page and use JS to hide it and record the number of selected choices in your matrix question.  Then use the text entry question in your matrix question validation condition.


@TomG thanks for the answer, seems like I am not able to capture the count of responses a user has provided for the likert answer. Additionally, there seems to be one more nuance associated with the likert question, that once you have selected the options for a statement you can’t deselect it.

Do you have a workaround for both?


@TomG thanks for the answer, seems like I am not able to capture the count of responses a user has provided for the likert answer. Additionally, there seems to be one more nuance associated with the likert question, that once you have selected the options for a statement you can’t deselect it.

Do you have a workaround for both?

For the first item, use addOnPageSubmit to count the number of checked radio buttons (or checkboxes - see below) in the matrix question and set the value of the text entry with that count.

For the second item, if you are interested I have a function uncheckRadios that allows radio buttons to be deselected. Alternatively, you could make it a multi-select and make all the scales points exclusive.


@TomG thanks for the explanation. I checked the link for ‘uncheck radios’ and it looks promising. 

Would you be able to help with Javascript for both of these use cases, as I am not proficient at JS as well as coding.

help is very much appreciated.


Leave a Reply