====== ddAutoComplete - Automatically select and optionally hide drill down selects (drop downs) with one choice ======
The **ddAutoComplete** function automatically selects and optionally hides drill down selects (drop downs) with one choice. It automatically detects the number of selects and their choices -- just add the function call to a drill down question and that's it!
Here is a quick video demonstration with the hide option enabled:\\
{{ ::ddAutoComplete.mp4?650 |ddAutoComplete Demonstration}}
Here is a demonstration of the same question the hide option disabled:\\
{{ ::ddAutoComplete_nohide.mp4?650 |ddAutoComplete 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 =====
==== Survey Header ====
Add the ddAutoComplete function to the survey header to make it available to any question in the survey. Go to Look & Feel -> General -> Header edit -> {{::icon_source.jpg?20|}} and paste the provided ddAutoComplete function JS:
Alternatively, paste the ddAutoComplete function JS into a question's JS outside the existing Qualtrics functions to make it available to questions on the page.
=== Question JavaScript ===
Add JS to call the ddAutoSelect function to apply it to the drill down question as follows:
Qualtrics.SurveyEngine.addOnload(function() {
ddAutoComplete(this);
});
To override the default options, specify the desired **[[ddAutoComplete#options|options]]** is the second function argument as an object. For example:
Qualtrics.SurveyEngine.addOnload(function() {
ddAutoComplete(this,{hide:false});
});
===== Options =====
==== hide ====
A boolean to enable the hiding of selects (drop downs) with one choice (option).
Default: true
====== Qualtrics Wiki ======
[[start|Qualtrics Wiki]]