Bootstrap-Select Doesn't show ticks next to selected parameters (multiple)

I have a problem with a selector where I define as:

 <select name='provs[]' id="prov" class="selectpicker" data-live-search="true" required multiple> 


However, when I select data, it doesn't show me a checkmark next to the options. I am using bootstrap 2.3.2 with bootstrap-select. I have css and js of these added to my assertions. I can select and receive values, however, I cannot see ticks next to the parameters when I select them.



source to share

2 answers

It's always a good idea to review the scripts you are using, even if they don't really matter, they will make sense after a while.


See lines 942-965 and find near the bottom:

$.fn.selectpicker.defaults = {
.... // bunch of default settings
iconBase: 'glyphicon', // the font family for the checkmark
tickIcon: 'glyphicon-ok', // classname for the checkmark


The default is glyphicon, part of Bootstrap 3. You will need to install this font, or you can use the font Awesome (go to their website, follow the instructions) and change two values ​​when you call the script:

   iconBase: 'NameofFOnt',
   tickIcon: 'classname'




add font awesome css to HTML page.

 <link href="" rel="stylesheet">


and replace them in bootstrap-select.js


iconBase: 'glyphicon', tickIcon: 'glyphicon-ok'



iconBase:"fontawesome",tickIcon:"fa fa-check"




All Articles