Im developing a school project using asp.net and c# and i need to make my multiselect dropdown menu to show in the text box the number of itens selected like he does when i select more than 4 elements, but i need to do that always. Exists any way of doing that, and exists any way to make the text box have always the same width.
Thats the box when i dont select nothing
Thats the box when i select 1,2 or 3 elements
Thats the box when i select more than 4 option
My select code.
<select class="listbox" asp-for="ap" multiple" >
@foreach(var i in Model.Aps)
{
<option [email protected]_id> @i.ap_name </option>
}
</select>
<script type="text/javascript">
$(function () {
$(".listbox").multiselect({
includeSelectAllOption: true
});
});
</script>
I want to show like when i select more than 4 options but allways,even though i just select 1,2 or 3 elements, exists any way of doing that?
And exists any way of just show like 10 elements and have to scroll down to see the rest of the elements?
2
Answers
Use this version of multiselect bootstrap to make the text box have the same width
And
numberDisplayed means how many options you select before it shows "x selected"
Below is work demo, you can refer to it.
refer to :numberDisplayed
How to hide the checkboxes?
result: