Question T12899
Visible to All Users

Multiple choice Matrix

created 2 years ago (modified 2 years ago)

Hello SurveyJS Team

I have a question regarding the Multiple choice Matrix question

When writing a question, the answer depends on the choices entered, but I want the answer to be based on the Rows,

Which means that it is completely similar to a question Single choice Matrix but the difference is that you can enter more than one answer,

And I will attach an example of my idea

Kind Regards,
Amro

Answers approved by surveyjs Support

created 2 years ago (modified 2 years ago)

Hello Amro,
You can configure a Multiple-Choice Matrix as demonstrated in your screenshot. For this, configure a Checkbox column and enable its showInMultipleColumns option, as demonstrated in the following demo: Matrix cell in several columns.

Consider this survey JSON model:

JSON
{ "pages": [ { "name": "page1", "elements": [ { "type": "matrixdropdown", "name": "question1", "columns": [ { "name": "checkbox-column", "cellType": "checkbox", "showInMultipleColumns": true } ], "choices": [ 1, 2, 3, 4 ], "rows": [ "Q1", "Q2", "Q3", "Q4" ] } ] } ] }

Example

Clipboard-File-1.png

Please let me know if this configuration works for you.

    Show previous comments (2)

      Hi Amro,

      To add a None option to this matrix, configure choices for your Checkbox column and enable its showNoneItem option. To set all rows as required, enable a column's isRequired option:

      JSON
      { "logoPosition": "right", "pages": [ { "name": "page1", "elements": [ { "type": "matrixdropdown", "name": "question1", "columns": [ { "name": "checkbox-column", "cellType": "checkbox", "isRequired": true, "showInMultipleColumns": true, "choices": [ { "value": "item1", "text": "1" }, { "value": "item2", "text": "2" }, { "value": "item3", "text": "3" }, { "value": "item4", "text": "4" } ], "showNoneItem": true } ], "rows": [ "Q1", "Q2", "Q3", "Q4" ] } ] } ] }

      Example
      Clipboard-File-1.png

      Drop me a line if any questions remain.

        Yes, everything for me works fine, Many Thanks.

        My last question,

        This works if it was added via JSON. Can I do it from the creator page without going back and modifying JSON?

          Hi Amro,
          You're very welcome.

          Yes, you can configure these settings in a Creator. For this, activate a Property Grid element selector, select a matrix column and configure required settings in Property Grid.

          Let me know if you have additional questions.