Using C# MVC razor to pull a dropdown list from the controller.
Then added the Select2 jquery to the id of the dropdown with a multiselect option in the jquery.
@Html.DropDownList(“pathologyField”, null, “”, htmlAttributes: new { @class = “textbox-control” })
$(document).ready(function () { $("#pathologyField").select2({multiple: true, allowClear: true, placeholder: “Select”, maximumSelectionLength: 6 }); });
This works in terms of giving me access to the jquery but when i click on the first option in the drop-down, it adds the placeholder in the input. I would like the Select placeholder to be there but when you click the drop-down it must only show the options clicked and not the placeholder as well.