/Filterable-select-widget

An easy select plugin for filterable select

Primary LanguageJavaScript

Filterable-select-widget

An easy select plugin for filterable select

Usage

  1. Add necessary .js and .css to your page (jQuery 1.7+ required)
<script src="FilterableSelect/filterableSelect.js"></script>
<link rel="stylesheet" href="FilterableSelect/css.css">
  1. Let's say you have a <select> that needs to be filterable
<select id="my-select"></select>
  1. Just call MakeSelectFilterable function on your jQuery object $my-select
<script type="text/javascript">
    $('#my-select').MakeSelectFilterable(OnSelectChange);

    //Optional callback
    function OnSelectChange(selectElem) {
        var option = $(selectElem).children('option:selected').text();
        console.log('You have choosen an option: ' + option);
    }
</script>