Monday, June 3, 2024
21
rated 0 times [  23] [ 2]  / answers: 1 / hits: 116554  / 12 Years ago, wed, january 23, 2013, 12:00:00

Trying to use Select2 and getting this error on multiple item input/text field:



query function not defined for Select2 undefined error

More From » runtime-error

 Answers
121

Covered in this google group thread




The problem was because of the extra div that was being added by the select2. Select2 had added new div with class select2-container form-select to wrap the select created. So the next time i loaded the function, the error was being thrown as select2 was being attached to the div element. I changed my selector...




Prefix select2 css identifier with specific tag name select:



$('select.form-select').select2();

[#80671] Tuesday, January 22, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
billtreytonb

Total Points: 211
Total Questions: 104
Total Answers: 114

Location: Sudan
Member since Tue, Aug 3, 2021
3 Years ago
;