User Tools

Site Tools


uncheckradios

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
uncheckradios [2023/08/28 12:55] – created adminuncheckradios [2024/08/23 10:03] (current) admin
Line 1: Line 1:
-====== uncheckRadios-  ====== +====== uncheckRadios - Deselect radio buttons on any question type that contains radio buttons  ====== 
-The uncheckRadios function deselects radio buttons in question types that use them: multiple choice, nps, matrix, side-by-side, and rank order. Radio buttons can be deselected on click or on-demand+The uncheckRadios function deselects radio buttons in question types that use them: multiple choice, nps, matrix, side-by-side, and rank order. Radio buttons can be deselected on click or on-demand (i.e., immediately).
  
 Functionality includes: Functionality includes:
-  * Works on any question type with radio buttons+  * Works on any question type with radio buttons: Multiple Choice, Matrix, Side-by-Side, Rank Order
   * On click functionality to deselect a selected radio button by clicking on it   * On click functionality to deselect a selected radio button by clicking on it
   * On demand functionality to deselect one or more radio buttons immediately   * On demand functionality to deselect one or more radio buttons immediately
   * 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)   * 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)
  
-This function is available for a reasonable fee. Contact **[[https://community.qualtrics.com/XMcommunity/messages/add/TomG|TomG]]** on the Qualtrics Community to learn more.+Here is a quick video demonstration:\\ 
 +{{ ::uncheckRadios.mp4?650 |uncheckRadios Demonstration}} 
 + 
 +This function is available for a reasonable fee. Contact **[[https://community.qualtrics.com/inbox/conversation?with=373|TomG]]** on the Qualtrics Community to learn more.
  
 ===== Set-up Instructions ===== ===== Set-up Instructions =====
Line 17: Line 20:
 </code> </code>
 Alternatively, paste the uncheckRadios function JS into a question's JS outside the existing Qualtrics functions to make it available to questions on the page. Alternatively, paste the uncheckRadios function JS into a question's JS outside the existing Qualtrics functions to make it available to questions on the page.
-==== Multiple Choice Question ==== +==== JavaScript Function Call ==== 
-=== Question Settings === +The uncheckRadios function can be invoked number of ways depending on the usage scenarioTo call the function with default options use:
-Any "Answers" setting is valid. +
- +
-If "Answers" is set to either "Single Answer" or "Multiple Answer", "Position" should be set to "Vertical" (fully compatible with **[[mccolumns|mcColumns]]** if column layout is desired). +
-=== Question JavaScript === +
-Add JS to call the mcAlphabetize function to apply it to the Multiple Choice question as follows:+
 <code> <code>
 Qualtrics.SurveyEngine.addOnload(function() { Qualtrics.SurveyEngine.addOnload(function() {
- mcAlphabetize(this);+ uncheckRadios();
 }); });
 </code> </code>
- +To override the default options, specify the desired options as an object. For example:
-For anchored choicesuse the **[[mcalphabetize#anchors|anchors]]** option to specify the choice ids as an array in the order the choices should be listed. For example:+
 <code> <code>
 Qualtrics.SurveyEngine.addOnload(function() { Qualtrics.SurveyEngine.addOnload(function() {
- mcAlphabetize(this,{anchors:[7,8]});+        var radios = jQuery("#"+this.questionId+" [type=radio]"); 
 + uncheckRadios({radios:radios,onclick:true}); //only this question on click
 }); });
 +</code>
 +=== 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:
 +<code>
 +<script>
 +Qualtrics.SurveyEngine.addOnload(function() {
 + uncheckRadios({onclick:true});
 +});
 +</script>
 </code> </code>
 ===== Options ===== ===== Options =====
-==== anchors ==== +==== radios ==== 
-**anchors** specifies the array of choice ids that should be anchored to the bottom of the list. +**radios** specifies the radio buttons to deselect either immediately or on click**radios** can be a jQuery objectelement, or selector.
- +
-For multi-select boxesthe choice ids are specified as "QR~QIDxx~id" where 'QIDxx' is the QID of the question and 'id' is the choice id. For all other answer typesthe choice id is a number or a number preceded by 'x' for carry forward questions.+
  
-To identify choice ids, preview the question and use the Inspect feature of your browser.+Default: %%"[type=radio]"%% (selector for all radio buttons on page) 
 +==== onclick ==== 
 +**onclick** specifies if radio buttons should be deselected on click (true) or immediately (false).
  
-Default: [] (nothing anchored)+Default: false
 ====== Qualtrics Wiki ====== ====== Qualtrics Wiki ======
 [[start|Qualtrics Wiki]] [[start|Qualtrics Wiki]]
uncheckradios.1693241751.txt.gz · Last modified: by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki