Friday, April 12, 2024

How to create dropdown with multi select in HTML and javascript and JQuery

<select id="ddlZone" multiple="multiple" class="form-select form-select-sm form-control"></select>


$(document).ready(function () {

    $('#ddlZone').multiselect({

        includeSelectAllOption: true,

        enableFiltering: true,

        maxHeight: 600,

        //dropUp: true,

        buttonWidth: '250px',

        enableCaseInsensitiveFiltering: true,

        onDropdownHidden: function (event) {

            ddlZone_onClientDropDownClosed();

            //GetDashBoardSummary();

        },

        templates: {

            button: '<button type="button" class="form-select multiselect dropdown-toggle btn-sm" data-bs-toggle="dropdown" aria-expanded="false" style=" border: 1px solid #dee2e6; border-radius: 15px;"><span class="multiselect-selected-text"></span></button>',

        },

    });

});

No comments:

Post a Comment