Adding search functionality in select options using Select2 and Bootstrap

Sample Dropdown using Select2


<link href="base/assets/js/select2/select2.min.css" rel="stylesheet" />
<link href="base/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">

<select class="select2 form-control mb-3 custom-select" style="width: 100%; height:36px;" id="prgcat-list" name="prgcat-list">
<option hidden disabled selected value>Choose Category</option> <option value='1'>Region</option> <option value='2'>Zone</option> <option value='3'>Club</option> <option value='4'>Category</option> </select> <script src="base/assets/js/select2/select2.min.js"></script> <script> $("#prgcat-list").select2({ allowClear:true, placeholder: 'prgcat-list' }); </script>

CDN Links for files:
https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css
https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js
OR
https://cdnjs.com/libraries/select2
https://cdnjs.com/libraries/select2-bootstrap-css

Comments

Popular posts from this blog

Domain Name Registration in Agra

Things to know about Popup

WEB DEVELOPMENT COMPANY IN CHANDAUSI