Table of Contents
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 (i.e., immediately).
Functionality includes:
- Works on any question type with radio buttons
- On click functionality to deselect a selected radio button by clicking on it
- 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)
Here is a quick video demonstration:
This function is available for a reasonable fee. Contact TomG on the Qualtrics Community to learn more.
Set-up Instructions
Survey Header
Add the uncheckRadios 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 uncheckRadios function JS:
<script>/*Paste uncheckRadios function JS here*/</script>
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.
JavaScript Function Call
The uncheckRadios function can be invoked a number of ways depending on the usage scenario. To call the function with default options use:
Qualtrics.SurveyEngine.addOnload(function() { uncheckRadios(); });
To override the default options, specify the desired options as an object. For example:
Qualtrics.SurveyEngine.addOnload(function() { var radios = jQuery("#"+this.questionId+" [type=radio]"); uncheckRadios({radios:radios,onclick:true}); //only this question on click });
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:
<script> Qualtrics.SurveyEngine.addOnload(function() { uncheckRadios({onclick:true}); }); </script>
Options
radios
radios specifies the radio buttons to deselect either immediately or on click. radios can be a jQuery object, element, or selector.
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: false