简体   繁体   English

Select Bootstrap 搜索事件

[英]Select Bootstrap Search Event

i have a bit problem with a select search of bootstrap, i need get the value of the search.我对引导程序的select搜索有点问题,我需要获取搜索的值。

 <div class="form-group has-feedback has-feedback-left">
        <select class="form-control bootstrap-select" data-live-search="true" asp-for="Client" asp-items=@ViewBag.clients></select>
 </div>

i'm trying to get into a change event, but only can get the id and the value of the option, but not of the search value...我正在尝试进入change事件,但只能获取选项的 ID 和值,但不能获取搜索值...

$("#Client").change(function () {
     alert(this.value);
});

You can get the search value in live-search textbox by this:您可以通过以下方式在实时搜索文本框中获取搜索值:

$("#Client").change(function () {
    alert($(".bs-searchbox").find("input").val());
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM