#6398·select2

Ajax and Enter

Author: ylmz-12Created Mar 15, 2026Updated Sep 13, 2026

Hi;

I'm encountering a problem while using select2. What I want is for it to find the data I type in the search box in the database, and if it can't find it, to create a new label.

However, when I use AJAX and receive a "no results found" error, I can't use the Enter key. If it finds at least one result, it creates a new label, but if it doesn't find any results, the Enter key doesn't work. Labels are only created if I have defined "tokenSeparators" and press those keys.

Thank you for your support.