Using Select2 in Drill Down Questions | XM Community
Skip to main content
I have a drill down question in which I would like respondents to have the ability to start typing text and pull up matching answer choices to select from. I've seen other posts mention that using Select2 allows for this kind of functionality (I am a novice when it comes to using JavaScript). However, when I enter the following into the JavaScript for the question the search box only appears for the first item in the drill down and not the second. Any suggestions?



var options = {

placeholder: 'Select an option'

};

jQuery("#"+this.questionId).find('select:first').select2({options});
select:first only returns the first select. If you remove :first it will return all the selects.
Great, thank you! That worked!

Leave a Reply