下拉输入搜索 bootstrap-select
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/css/bootstrap-select.min.css">
<div class="col-lg-2">
<span class="input-group input-group-sm">
<span class="input-group-addon"><b>企业列表:</b></span>
<select name="com_id" id="com_id" class="selectpicker show-tick form-control" data-live-search="true" style="position: relative; left:-4px;z-index: 1;border-radius:3px;" aria-describedby="object">
<option value="">--请选择--</option>
<volist name="com_lists" id="vo">
<option value="{$vo.id}" <?php if($vo['id'] == $com_id){echo "selected";} ?> > {$vo.id} . {$vo.name} </option>
</volist>
</select>
</span>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/js/bootstrap-select.min.js"></script>
$(function () {
$('.selectpicker').selectpicker();
})
- tips: data-live-search="true" 不要丢了
- https://jingyan.baidu.com/article/456c463b06c9920a5831449b.html
- http://www.bootstrapmb.com/tag/sousuoxiala
相信坚持的力量,日复一日的习惯.