I need custom validation to make sure the survey taker can only chose one option per statement | XM Community
Solved

I need custom validation to make sure the survey taker can only chose one option per statement

  • 1 June 2023
  • 5 replies
  • 82 views

Userlevel 5
Badge +13

This is the setup that I was trying to create….I am using side by side question type and put a table in the statement part to get the two statement and or to show pretty close to the setup.  Now for the part where they can only check one option is the problem now.  Can someone help me with the validation code?  

I am using side by side question type to make sure that the survey will be accessible since the brand has the inaccessible questions turned off.

icon

Best answer by Eumetis 29 June 2023, 17:02

View original

5 replies

Userlevel 5
Badge +11

This is the setup that I was trying to create….I am using side by side question type and put a table in the statement part to get the two statement and or to show pretty close to the setup.  Now for the part where they can only check one option is the problem now.  Can someone help me with the validation code?  

I am using side by side question type to make sure that the survey will be accessible since the brand has the inaccessible questions turned off.

Hi Linda, 

Could you elaborate the question more, like what are two check boxes on each side and how are you setting it up in Qualtrics

Userlevel 5
Badge +13

The boxes are on the left side is Very much like this Child and Sort of like this child

The boxes are on the right side is Sort of like this child and Very much like this child

I am using side by side question type somehow I do have the statements in the middle and the two boxes on each side.  To get the statements show right I am put them in a table diving the cell.

So for each line you can only pick one of the check box.

 

Userlevel 5
Badge +11

The boxes are on the left side is Very much like this Child and Sort of like this child

The boxes are on the right side is Sort of like this child and Very much like this child

I am using side by side question type somehow I do have the statements in the middle and the two boxes on each side.  To get the statements show right I am put them in a table diving the cell.

So for each line you can only pick one of the check box.

 

I have setup the question like this and rather than having a check box if single answer option is selected the answer choices automatically become exclusive (only one of the 4 can be selected)

Userlevel 5
Badge +13

We were trying to keep the look of the survey that she was using that is why we had it setup the way we did.

Userlevel 5
Badge +11

We were trying to keep the look of the survey that she was using that is why we had it setup the way we did.

You can add the below code in javascript window. This was answered on this link
Qualtrics.SurveyEngine.addOnReady(function()
{
    /*Place your JavaScript here to run when the page is fully displayed*/

   /*Place your JavaScript here to run when the page loads*/
   jQuery("#"+this.questionId+" input[type=checkbox]").click(function() {
      if(this.checked) {
var cb = jQuery(this);
cb.closest("tr").find("[type=checkbox]").not(cb).prop("checked",false);
      }
   });

});

Leave a Reply