addrequirements
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| addrequirements [2024/02/25 11:58] – created admin | addrequirements [2024/02/25 12:32] (current) – [CSS] admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== addRequirements - Automatically | + | ====== addRequirements - Automatically |
| - | The uncheckRadios function deselects radio buttons in question types that use them: multiple choice, nps, matrix, side-by-side, | + | The addRequirements adds CSS classes to questions to specify if they are force response, request response, or optional. The classes |
| - | Functionality includes: | + | Since constant sum questions don't have a force response option, they are considered |
| - | * Works on any question type with radio buttons | + | |
| - | * On click functionality to deselect | + | |
| - | * On demand functionality | + | |
| - | * Can be applied globally, by page, by question, or on specific radio buttons or groups of radio buttons (e.g., one column of a side-by-side) | + | |
| - | Here is a quick video demonstration: | + | The addRequirements function |
| - | {{ :: | + | |
| This function is available for a reasonable fee. Contact **[[https:// | This function is available for a reasonable fee. Contact **[[https:// | ||
| - | |||
| ===== Set-up Instructions ===== | ===== Set-up Instructions ===== | ||
| ==== Survey Header ==== | ==== Survey Header ==== | ||
| - | Add the uncheckRadios | + | Add the addRequirements |
| < | < | ||
| - | < | + | < |
| </ | </ | ||
| - | Alternatively, | ||
| ==== JavaScript Function Call ==== | ==== JavaScript Function Call ==== | ||
| - | The uncheckRadios | + | Call the addRequirements |
| < | < | ||
| + | < | ||
| Qualtrics.SurveyEngine.addOnload(function() { | Qualtrics.SurveyEngine.addOnload(function() { | ||
| - | uncheckRadios(); | + | addRequirements(); |
| }); | }); | ||
| + | </ | ||
| </ | </ | ||
| - | To override the default | + | ===== Turn off/on ===== |
| + | By default, | ||
| + | ===== CSS ===== | ||
| + | Use the CSS classes **force**, **request**, | ||
| < | < | ||
| - | Qualtrics.SurveyEngine.addOnload(function() | + | /*Force response - asterisk before question text*/ |
| - | var radios = jQuery("#"+this.questionId+" | + | .force .QuestionText:: |
| - | uncheckRadios({radios:radios, | + | /*Optional response - optional label after question text*/ |
| - | }); | + | .optional .QuestionText:: |
| + | content:"(Optional)"; | ||
| + | | ||
| + | font-style:" | ||
| + | } | ||
| </ | </ | ||
| - | === Global === | ||
| - | To be able to globally deselect radio buttons (i.e., throughout the entire survey) by clicking on them, call the uncheckRadios function from the survey header or footer with the onclick option set to true: | ||
| - | < | ||
| - | < | ||
| - | Qualtrics.SurveyEngine.addOnload(function() { | ||
| - | uncheckRadios({onclick: | ||
| - | }); | ||
| - | </ | ||
| - | </ | ||
| - | ===== Options ===== | ||
| - | ==== radios ==== | ||
| - | **radios** specifies the radio buttons to deselect either immediately or on click. **radios** can be a jQuery object, element, or selector. | ||
| - | |||
| - | Default: %%" | ||
| - | ==== onclick ==== | ||
| - | **onclick** specifies if radio buttons should be deselected on click (true) or immediately (false). | ||
| - | |||
| - | Default: false | ||
| ====== Qualtrics Wiki ====== | ====== Qualtrics Wiki ====== | ||
| [[start|Qualtrics Wiki]] | [[start|Qualtrics Wiki]] | ||
addrequirements.1708880333.txt.gz · Last modified: by admin
