Copying and Pasting JS from one survey into another is not working - why? | XM Community
Solved

Copying and Pasting JS from one survey into another is not working - why?

  • 26 February 2019
  • 2 replies
  • 2 views

Userlevel 4
Badge +20
Hello - I have a survey that is currently working with JS for a date picker and Select2 (from my previous picklist question) . I have created a new survey and copied and pasted the JS from the functioning survey to the new questions, as well as the header info. The new questions are the exact same type of questions. The JS for date picker works fine but the select2 will not work. In case it helps I have attached the JS text files. What am I missing here?
icon

Best answer by TomG 26 February 2019, 18:44

View original

2 replies

Userlevel 7
Badge +27
Your select2 script is wrong. Assuming your question is just a drop down, try:
```
jQuery("#"+this.questionId+" select").select2({
multiple: true
});
```
Userlevel 4
Badge +20
That worked and it fixed my carry forward logic! Thank you @TomG

Leave a Reply