Prevent ajax on focus on select element

60 views
Skip to first unread message

breeze...@gmail.com

unread,
Sep 16, 2016, 2:46:05 AM9/16/16
to select2
Hi

I am using ajax to fetch the data from remote with select2. Most of the things are working fine. Need help on fixing a couple of issues:

1. I used this option `minimumInputLength: 3` for preventing ajax unless usr input contains at least 3 characters. But it has no effect on the ajax. select2 is still sending the ajax for texts with lenth less than 3. How can i fix this?

2. When i focus on the select box associated to select2, it sends an ajax even before i type something and gives me "No results found". How can i stop that request and not show this message until user actually types something?

Thanks

janne....@gmail.com

unread,
Nov 23, 2016, 4:44:09 AM11/23/16
to select2
Having the same issue here on 4.0.3

janne....@gmail.com

unread,
Nov 23, 2016, 4:46:48 AM11/23/16
to select2, janne....@gmail.com
Really strange. I had this issue for ~10-15 minutes and decided to give it one more try. Suddenly it started to work, and I haven't made other apparent changes than represented couple of new language translations manually... strange.
Reply all
Reply to author
Forward
0 new messages