Solved

bootstrap multiselect - what is rong with this script ?

Posted on 2014-12-14
5
657 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
Comment Utility
Probably because these are not found

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

Author Comment

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

Expert Comment

by:Gary
Comment Utility
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
Comment Utility
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
Comment Utility
Needs to be after the jQuery library, not before it.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn how to dynamically set the form action using jQuery.
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…

771 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

15 Experts available now in Live!

Get 1:1 Help Now