Select2 with MultiSelect Box Displaying Problems | XM Community
Skip to main content

Select2 with MultiSelect Box Displaying Problems

  • March 10, 2021
  • 15 replies
  • 958 views

Forum|alt.badge.img

Hello,
I'm using the select2 script and I'm having a bug come up.
I have a list of schools in my survey that I want my users to select from. When I use it in a survey (please feel free to use this preview link to see for yourself), the box is displaying in all my following questions. NOTE: This is happening in the real survey as well.
Does anyone happen to know if this is a Qualtrics bug? Do anyone have any solutions?

Preview - Online Survey Software | Qualtrics Survey Solutions


https://norc.az1.qualtrics.com/jfe/preview/SV_7O0bB43qDIlxHjU?Q_CHL=preview&Q_SurveyVersionID=current
Qualtrics makes sophisticated research simple and empowers users to capture customer, product, brand & employee experience insights in one place.

This is the image that comes up in the next page of my survey. It should simply be the next question.
image.png

15 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • March 11, 2021

I think it works, but it is super slow. I've used select2 with Qualtrics many times and never had a performance issue. Post your JS.


Forum|alt.badge.img
  • Author
  • March 11, 2021

In the question itself, I have:
Qualtrics.SurveyEngine.addOnReady(function()
{
        /*Place your JavaScript here to run when the page is fully displayed*/
        jQuery("#"+this.questionId).find('select:first').select2();
});
In the header I have the following HTML:
https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />">https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js">


Forum|alt.badge.img
  • Author
  • March 12, 2021

Hey Tom,
Do you have any thoughts on this?
Thanks,
Mark


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • March 12, 2021

malush1412 ,
I just took another look at it. I think it is slow because you have 6,219 schools in the list. To speed it up you need to store the schools in an external database and use the select2 ajax functionality to populate the list of schools in smaller chunks.


Forum|alt.badge.img
  • Author
  • March 12, 2021

Any idea why the school drop down is showing up on the next questions? Seems like a bug.


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • March 12, 2021

I think it is related to the list length and performance issue. Select2 creates a temporary list outside the virtual JFE page and it isn't able to destroy the list fast enough before Qualtrics moves to the next page.


Forum|alt.badge.img
  • Author
  • March 12, 2021

Got it! Thanks so much for all the feedback.


Forum|alt.badge.img
  • Author
  • March 12, 2021

Ah - so it seems as though the list is disappearing one the follow up questions, but only once you click into the list again.
Wonder if there's a workaround to stop that bug from showing up?


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • March 12, 2021

You need to focus on the performance issue because even without the bug the usability is awful. ajax is the solution.


Forum|alt.badge.img
  • Author
  • March 12, 2021

I'm loading the file up - but even as I test this with 4 options (A, B, C, D) the box is displaying in the following questions.


Forum|alt.badge.img
  • Author
  • March 15, 2021

Hi Tom,
This issue still happens even when I use a list with only 4 options (see image below).
Here's a preview link: https://norc.az1.qualtrics.com/jfe/preview/SV_7O0bB43qDIlxHjU?Q_CHL=preview&Q_SurveyVersionID=current
image.png


Forum|alt.badge.img+1
  • March 15, 2022

https://community.qualtrics.com/XMcommunity/discussion/15179/select2-with-multiselect-box-displaying-problemsHello,
I am having this same issue with two of my questions. Were you able to solve it?

Best,

Ana


Forum|alt.badge.img+1
  • January 27, 2023

https://community.qualtrics.com/XMcommunity/discussion/comment/44590#Comment_44590This issue still occurs (or occurs for me anyway). Has anybody found a way to stop the dropdown from displaying on the next page (where there's no dropdown question)? Thanks in advance!
Dan


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • January 27, 2023

Forum|alt.badge.img+1
  • January 27, 2023

Thanks for the tip, Tom. That seems to have fixed it! Thanks so much for the help!
Old header in Qualtrics: https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> ">https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js">
New header: https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> ">https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.min.js">