@TomG Thank you worked perfect!
@TomG or
@CameronBudd would you mind helping me getting this to work as well?
Specifically, I run the 'select2' with the following details:
HEADER
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script> <link rel="stylesheet"
QUESTION JAVASCRIPT
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId).find('select:first').select2();
});
QUESTION TYPE
I am running it as a Multi Select Box.
This works, and follows
@TomG's great input in other threads. Yet, I fail to 'integrate' the width part after following the external link above. Currently, the width is not large enough. Can you please advice? Also, I am certainly not an expert in this game, so the more specific you can be the better - I appreciate it!
- it cuts off parts of the element I have in the header. I am very sorry for the inconvenience and all these messages.
@Dennis_Jacobsen,
You specify the width in the select2 options object. Something like this:
```
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId).find('select:first').select2({width:"100%"});
});
```
P.S. On the Community, to post code like above, put in "fences" like this:
\\`\\`\\`
paste your code here
\\`\\`\\`