Michael
Michael

Reputation: 1

ASP.NET MVC editable dropdownlist box (combobox)

I am looking for a solution to an issue I have with a current ASP.NET MVC 4 project I am working on. I would like to have an editable dropdownlist control, or combobox as I think this type of control is sometimes called.

Where the control would operate as a typical dropdown control, but allow the user to type in a value that is not present in the dropdown list.

I have had no luck with my search so far so I am hoping that this great community of developers could point me in the right direction. Thanks!

Upvotes: -1

Views: 1934

Answers (1)

Roman Kiyashev
Roman Kiyashev

Reputation: 160

If you use HTML then you can use input with datalist attribute Example:

<input type="text" name="fieldName" list="valueList"/>
<datalist id="valueList">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
</datalist>

Upvotes: 3

Related Questions