Trying to use Select2 and getting this error on multiple item input/text field:
\"query function not defined for Select2 undefined error\"
In case you initialize an empty input do this:
$(".yourelement").select2({ data: { id: "", text: "" } });
Read the first comment below, it explains why and when you should use the code in my answer.