Question T13779
Visible to All Users

How to disable items in Multiple Choice Selection in matrix?

created 2 years ago

image.png

As it can be seen on the screen, in multiple matrix, the one who checks "HATIRLAMIYORUM" option should not be able to click for other columns. How can we ensure this?

Comments (3)

    Hello,
    Please let me clarify your task. Do you wish to allow users to select a single option per row?

      IF THE USER SELECTS "HATIRLAMIYORUM" IN A ROW, HE/SHE CANNOT SELECT "TOZ DETERJAN" - "LİKİT/JEL DETERJAN" - "TABLET DETERJAN".

      EXCEPT FOR THE "HATIRLAMIYORUM" OPTION, THE USER CAN SELECT AS HE/SHE LIKES IN ALL COLUMNS.

        Hello Dogukan,
        Thank you for the clarification.
        If you wish to prevent a user from selecting other row options if the user selected HATIRLAMIYORUM,
        and allow multiple options if a user selected another option, you can handle the survey.onMatrixCellValueChanging event, and programmatically allow/prevent a cell value from being changed.

        Answers approved by surveyjs Support

        created 2 years ago

        You can use enableIf on the choice level. Here is the example.

        JavaScript
        {       "type""matrixdropdown",       "name""matrix",       "columns": [         {           "name""col1",           "cellType""checkbox",           "showInMultipleColumns"true,           "isRequired"true,           "choices": [             {value"item1"enableIf"{row.col1} notcontains 'item4'" },             {value"item2"enableIf"{row.col1} notcontains 'item4'" },             {value"item3"  },             {value"item4"}           ]         }       ],       "rows": [         "row1",         "row2",         "row3"       ]     }

        Thank you,
        Andrew
        SurveyJS Team