S
S
SibVector2017-10-16 10:38:33
JavaScript
SibVector, 2017-10-16 10:38:33

How to update bootstrap combobox without breaking it?

I want to get and display a list of cities using the VK API.
Here's what happens: https://codepen.io/anon/pen/qPQPmb
But when you enter any letter in the input, Combobox automatically substitutes the first match due to the call to the Combobox.refresh () function. It turns out extremely unusable, how can I fix it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex-1917, 2017-10-16
@alex-1917

My hint starts with two letters. Well, not the point
Call the $.ajax request after checking the number of entered characters! Those. wrap $.ajax in a validation function, look it up in the jquery reference, there's only one line of it!
Although VK could add such a parameter to the method itself, or maybe they have it, they have a lot of things hidden there !!!
UPD. In general, put the INPUT tag and everything works!

K
Kirill Inkognatovich, 2017-10-16
@Matsunaki

59e4768448a7f893249641.png
Everything seems to be correct? :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question