Table of Contents
mcSelectAll - Select/Deselect all non-exclusive choices in a multi-select multiple choice question
The mcSelectAll function changes a choice in a multi-select multiple choice to a 'Select all/Deselect all' choice. Features include:
- Select all/Deselect all choice can be placed in any order (first, last, etc.)
- Dynamic choice text
- Works with any alignment (vertical, horizontal, column)
- Compatible with exclusive choices
- Compatible with back button
- Translation friendly
Here is a quick video demonstration:
To select all answers in a multi-select matrix question see matrixSelectAll.
This function is available for a reasonable fee. Contact https://community.qualtrics.com/inbox/conversation?with=373 on the Qualtrics Community to learn more.
Set-up Instructions
Survey Header
Add the mcSelectAll function to the survey header to make it available to any question in the survey. Go to Look & Feel → General → Header edit → and paste the provided mcSelectAll function JS:
<script>/*Paste mcSelectAll function JS here*/</script>
Alternatively, paste the mcSelectAll function JS into a question's JS outside the existing Qualtrics functions to make it available to questions on the page.
Select/Deselect All Choice Setup
To specify the Select all/Deselect all choice, put the choice text inside a span with the class selectAll
(selectAll
is the default class and can be changed in options). For example:
<span class="selectAll">All of these</span>
Please note: The choice text displayed to the respondent is specified in the selectText and deselectText options. The choice text inside the selectAll span is NOT displayed.
Question JavaScript
Add JS to call the mcSelectAll function to apply it to the multiple choice question as follows:
Qualtrics.SurveyEngine.addOnload(function() { mcSelectAll(this); });
To override the default options, specify the desired options is the second function argument as an object. For example:
Qualtrics.SurveyEngine.addOnload(function() { mcSelectAll(this,{selectText:'All the above',deselectText:'Deselect all the above'}); });
Options
deselectText
The choice text displayed when the Select/Deselect all choice is selected.
Default: "Deselect all of these"
selectClass
The html class name of the span used to identify the Select/Deselect all choice. See Select/Deselect All Choice Setup.
Default: "selectAll"
selectText
The choice text displayed when the Select/Deselect all choice is NOT selected.
Default: "All of these"