Hi All,
I have added a Pick, Group and Rank type question in my survey but the choices to select from are huge. Is there a way using Javascript where I can add a search bar on the pick box to filter out the choices?
Hi All,
I have added a Pick, Group and Rank type question in my survey but the choices to select from are huge. Is there a way using Javascript where I can add a search bar on the pick box to filter out the choices?
Best answer by Deepak
Will something like below work for you, add it to the pick, group, rank question.
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
jQuery('.Items h2').append(' <input type="text" id="search-box" placeholder="Search...">');
var items = jQuery('.itemsContainerTd li')
jQuery('#search-box').on('input', function() {
var searchTerm = jQuery(this).val();
jQuery(items).each(function() {
const text = jQuery(this).text().toLowerCase();
if (text.includes(searchTerm)) {
jQuery(this).show();
} else {
jQuery(this).hide();
}
});
});
});Hope it helps!
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.