Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mvc razor editable DropDownList

I am looking for a code to make the dropdown list editable in MVC razor. @Html.DropDownList provides the standard select list, but the values are not editable.

I tried an example from a tutorial, but it does not seem to work.

like image 935
daniele Avatar asked Jul 30 '26 18:07

daniele


1 Answers

First need to add the script reference to the page:

<script type="text/javascript" src="jquery.editable-select.pack.js"></script>

This If you host this script on your server.

You only need to set the id on you razor definition of the dropdown and then do this:

$('#nameOfDropDown').editableSelect({...});

After doing this and checking the documentation of this plugin you might be able to get a editable select list.

like image 186
jcvegan Avatar answered Aug 04 '26 21:08

jcvegan