making search terms not selectable

16 views
Skip to first unread message

do...@doppy.nl

unread,
Mar 21, 2016, 5:00:40 AM3/21/16
to select2
I'm using select2 with an ajax request to search for possible choices in a huge database. This works fine.

However, it is possible for the user to select the "searchterm" they entered. This is then added with value+display as an option to the select+option and passed to the server when the form is submitted.

Is there a way to prevent the user from selecting his own search term?
Or is there a way to "clear" the input and just make the select "nothing selected" when this happens?

Thank you
DoppyNL

Reply all
Reply to author
Forward
0 new messages