i have a bit problem with a select search of bootstrap, i need get the value of the search.
<div class="form-group has-feedback has-feedback-left">
<select class="form-control bootstrap-select" data-live-search="true" asp-for="Client" <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="24455754094d504149571964724d41536645430a47484d414a5057">[email protected]</a>></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…
$("#Client").change(function () {
alert(this.value);
});
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
You can get the search value in live-search textbox by this:
$("#Client").change(function () {
alert($(".bs-searchbox").find("input").val());
});
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0