Form using a huge selectbox

2 years ago

David Šolc
Member | 3
+
0
-

Hello,

I created a form with Kdyby/FormsReplicator and inside each container is a select box with “products”. Problem is that “products” are also created by the user and there is a lot of them now.

I looked at Select2, which I got working with ajax call loading data from DB via some query using LIKE, but I got stuck with setting items for SelectBox, since I can not load all of the products and set them via setItems(), so I am unable to getValues() on form, because of getValue() on the selectBox. Another story is that I used this form to also edit these values via setDefaults(), so it is also not working, since it does not have items set.

So I was thinking about some kind of ajax SelectBox, which will set items dependent on a query sent from Select2 and possibly set items (which will be set as defaults)?

Any ideas or a piece of advice?

Thanks a lot for any!

Last edited by David Šolc (2016-11-28 20:24)

2 years ago

CZechBoY
Member | 3234
+
0
-

Try some addon, for example https://github.com/nextras/forms component typeahead.

2 years ago

Semmit
Member | 1
+
0
-

Prompt please, whether such forms are freely used in the variant with the proxy server? You know, it should not interfere with each other, but better to ask.

Last edited by Semmit (2017-03-10 12:45)