Solved

bootstrap multiselect - what is rong with this script ?

Posted on 2014-12-14
5
686 Views
Last Modified: 2014-12-15
it is not working, i just copied an example, what' wrong ? the options are not showing

   <!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>     </title>
        <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">	
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
     	
         <script src="js/bootstrap-multiselect.js"></script>     
    <link rel="stylesheet" href="css/bootstrap-multiselect.css" type="text/css" media="screen"/>
 	        
    </head>
    <body>
            

            
                        
    
        <div class="panel-group" id="example-collapse-accordion">
          <div class="panel panel-default" style="overflow:visible;">
            <div class="panel-heading">
            <h4 class="panel-title">
            <a data-toggle="collapse" data-parent="#example-collapse-accordion" href="#example-collapse-accordion-one">
            Bootstrap Multiselect
            </a>
            </h4>
            </div>
            <div id="example-collapse-accordion-one" class="panel-collapse collapse in">
            <div class="panel-body">
                <select id="example-collapse" multiple="multiple">
                    <option value="1">Option 1</option>
                    <option value="2">Option 2</option>
                    <option value="3">Option 3</option>
                    <option value="4">Option 4</option>
                    <option value="5">Option 5</option>
                    <option value="6">Option 6</option>
                  </select>
              </div>
            </div>
            </div>
    </div>
    
    
    
   
   <script>


    $(function() {	

        $('#example-collapse').multiselect(
        	{
     	    	   includeSelectAllOption: true,
     	    	   maxHeight: 200,
     	    	   enableClickableOptGroups: true,
     	    	   enableFiltering: true
     	    	   }    

        		
                ); 
	 
	  		
		});	
		
	       
  </script> 
  
 </body>
 </html>   

Open in new window

0
Comment
Question by:sniger
  • 3
  • 2
5 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40499155
Probably because these are not found

js/bootstrap-multiselect.js
and
css/bootstrap-multiselect.css
0
 

Author Comment

by:sniger
ID: 40499167
they are found, have you even bother to check ?
0
 
LVL 58

Expert Comment

by:Gary
ID: 40499185
Well you don't have the Bootstrap js file

<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

Open in new window


And get rid of the attitude.
0
 

Author Comment

by:sniger
ID: 40499224
i don't have attitude,

I added the bootstrap  , same thing
   <!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>     </title>
        <script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
        <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">	
        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
     	
         <script src="js/bootstrap-multiselect.js"></script>     
    <link rel="stylesheet" href="css/bootstrap-multiselect.css" type="text/css" media="screen"/>
 	        
    </head>
    <body>
        <div class="panel-group" id="example-collapse-accordion">
          <div class="panel panel-default" style="overflow:visible;">
            <div class="panel-heading">
            <h4 class="panel-title">
            <a data-toggle="collapse" data-parent="#example-collapse-accordion" href="#example-collapse-accordion-one">
            Bootstrap Multiselect
            </a>
            </h4>
            </div>
            <div id="example-collapse-accordion-one" class="panel-collapse collapse in">
            <div class="panel-body">
                <select id="example-collapse" multiple="multiple">
                    <option value="1">Option 1</option>
                    <option value="2">Option 2</option>
                    <option value="3">Option 3</option>
                    <option value="4">Option 4</option>
                    <option value="5">Option 5</option>
                    <option value="6">Option 6</option>
                  </select>
              </div>
            </div>
            </div>
    </div>
    
    
    
   
   <script>


    $(function() {	

        $('#example-collapse').multiselect(
        	{
     	    	   includeSelectAllOption: true,
     	    	   maxHeight: 200,
     	    	   enableClickableOptGroups: true,
     	    	   enableFiltering: true
     	    	   }    

        		
                ); 
	 
	  		
		});	
		
	       
  </script> 
  
 </body>
 </html>

Open in new window

0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40499234
Needs to be after the jQuery library, not before it.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now