-1
I have the following tag select
:
<select asp-for="@Model.EstadosServicos" asp-items="Html.GetEnumSelectList<EstadoServico>()" id="tipo" class="form-control"></select>
that creates this panel:
This rendered HTML in the browser generates this code containing, automatically, the attribute multiple="multiple"
:
<select id="tipo" class="form-control" multiple="multiple" name="EstadosServicos">
<option value="0">Inicial</option>
<option value="1">Intermediário</option>
<option value="2">Cancelado</option>
<option value="3">Final</option>
</select>
in the element inspection, when removing the multiple="multiple"
it then changes to the format of select
that I need.
The point is, how do I write my HTML so that it creates the select
as in the figure below? Or even, what should I do for that attribute multiple="multiple"
is not considered when rendering the page?
I don’t think I can do that, because the behavior of the select without the
multiple
is different from the attribute. One possible solution is to use Javascript to manipulate select so that it looks the way you want it to look and by clicking it, it can accept multiple selections.– Sam