Combobox in jquery

I searched the Internet for a long time, but I can’t find a combobox that fits my needs. Can someone help me? Thanks in advance!

What I need is a drop-down list that has an editable block that acts just like a drop-down list in a working Windows application. I have a list of values ​​for the user, but I also want them to be able to enter a value if the list does not contain the required value. I use ASP.NET MVC, so I want to make sure that the control can be bound using the default binder. Thank!

Regards

+3
source share
1 answer

Solutions to Professional jQuery based Combobox control? focused on using input as a means of filtering and autocompleting an existing selection value.

If you are looking for a traditional combo box that simply “Enter something or select from these predefined values” (no, we will not hide those that do not match during input) all you might need is

<select id="combo4" style="width: 200px;"
            onchange="$('input#text4').val($(this).val());">
    <option>option 1</option>
    <option>option 2</option>
    <option>option 3</option>
</select>
<input id="text4"
       style="margin-left: -203px; width: 180px; height: 1.2em; border: 0;" />

See http://bit.wisestamp.com/uncategorized/htmljquery-editable-combo-2/

It should be easy to wrap this in a plugin that converts an existing select tag, although I haven't seen it yet.

+4
source

Source: https://habr.com/ru/post/1741549/


All Articles