2

Boostrap select live search brings an error when typing into the box snapshot enter image description here

and javascript console error log

bootstrap-select.js:199 Uncaught TypeError: Cannot read property '3' of undefined at a.expr.pseudos.icontains (bootstrap-select.js:199) at jquery.js:15 at jquery.js:15 at jquery.js:15 at bm (jquery.js:15) at bm (jquery.js:15) at Z (jquery.js:15) at Function.Z.matches (jquery.js:15) at Function.filter (jquery.js:15) at bj (jquery.js:15) 

the select option

 <select class="selectpicker" data-live-search="true" multiple> <option data-tokens="mustard">Mustard</option> <option data-tokens="ketchup">Ketchup</option> <option data-tokens="relish">Relish</option> </select> 

selecting the options works.

importing the libs from a cdn

<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.1/js/bootstrap-select.min.js"></script>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.1/css/bootstrap-select.min.css">

3
  • Did you debug? Evidently you have an undefined somewhere. Commented Feb 8, 2017 at 18:10
  • haven't defined anything it's a blank bootstrap page with just the select box. @Carcigenicate Commented Feb 8, 2017 at 18:32
  • Maybe you loaded bootstrap-select before jQuery. Try loading jQuery first Commented Feb 28, 2018 at 4:06

2 Answers 2

0

Hi Drifter I have tried your example with following scripts and css. I didn't get any error. Hope there are some version compatibility issues are there in your code.Please find the scripts and css versions i have used.

 <script data-require="[email protected]" data-semver="2.2.4" src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> <link data-require="[email protected]" data-semver="3.3.7" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /> <script data-require="[email protected]" data-semver="3.3.7" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.1/js/bootstrap-select.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.1/css/bootstrap-select.min.css" /> 

Please find the plunker link here:

https://plnkr.co/edit/1keNc6d4z7Kq7476SRmp?p=preview

Hope it will help you and will work for you too. Please let me know if it works.

Sign up to request clarification or add additional context in comments.

Comments

-1

Add in Application.css

*= require bootstrap-select

1 Comment

See how do I write a good answer How to Answer.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.