0

When using select2, is there any way I can put a link in the "No results found" message? Meaning, the message that shows up when someone types in the select2, but there's no matching item. It seems to escape all text, so it doesn't seem like it is possible.

Here's what it looks like when a search term is typed in that's not in the list: enter image description here

Below, I have tried to change the noResults config, but it does not show a link, instead showing the escaped HTML

var config = {
        "language": {
                "noResults": function(){
                        return "If you see no results, please <a href="https://stackoverflow.com/disclaimer">see disclaimer</a>"
                }
         ...
        },
   }

jQuery(selector).select2(config);
2
  • Does this answer your question? Click event in select2 tag with a link Commented Feb 19, 2024 at 20:16
  • @Zak Thanks, but I'm not referring to custom tags. I'm referring to the message that shows up when there are no matches to what the user typed. Commented Feb 22, 2024 at 3:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.