</div>
</div>
<div class="grid--cell mb0 mt4">
<a href="/questions/195270/professional-jquery-based-combobox-control" dir="ltr">Professional jQuery based Combobox control? [closed]</a>
<span class="question-originals-answer-count">
(22 answers)
</span>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2013-10-23 15:48:47Z" class="relativetime">6 years ago</span>.</div>
</div>
</aside>
I've searched the Internet for quite a long time, but I can't find a combobox that fits my needs. Can anyone help me? Thanks in advance!
What I need is a dropdownlist that has an editable box, which acts exactly as the combobox in a Windows desktop application. I have a list of values for the user, but I also want them to be able to type in a value if the list doesn't contain the value they need. I'm using ASP.NET MVC, so I want to make sure the control can be bound by the default model binder. Thanks!
Best regards
</div>
The solutions on Professional jQuery based Combobox control? all focus on using the input as a means to filtering and autocompleting to an existing select value.
If you're looking for the traditional combo box, which is simply "Type something or select from these pre-defined values" (no we won't hide the ones that don't match while you're typing), all you may need to do 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/
Should be easy to wrap this into a plugin that converts an existing select tag, though I haven't seen that done yet.