jquery multiselect

<script type="text/javascript" src="${path}/commons/js/jquery.multiselect.js" ></script>

 		    $("#materialSelect").multiselect({        
  		    	noneSelectedText: "==请选择==",
        		checkAllText: "全选",
        		uncheckAllText: '全不选'
        		//selectedList:4
        	}); 
  			
  			$("#companySelect").multiselect({        
  		    	noneSelectedText: "==请选择==",
        		checkAllText: "全选",
        		uncheckAllText: '全不选'
        		//selectedList:4
        	}); 


	   function showValues() {	   		
    		var valuestr = $("#materialSelect").selectedValuesString();// multiselect("MyValues");    		
    		alert(JSON.stringify(valuestr));
    		
    		var comValue = $("#companySelect").selectedValuesString(); //multiselect("MyValues"); 
    		alert(JSON.stringify(comValue)); 
	   }

 

HTML CODE

 

 	  		<label   style="margin-left: 20px">材料类别:</label>  	  		
  	  		<select   id="materialSelect"  multiple="multiple"   name="materialSelect">
  	  			<option  value="型材">型材</option>
  	  			<option  value="板材">板材</option>
  	  			<option  value="型材1">型材1</option>
  	  			<option  value="板材1">板材1</option>
  	  			<option  value="型材2">型材2</option>
  	  			<option  value="板材2">板材2</option>
  	  			<option  value="型材3">型材3</option>
  	  			<option  value="板材3">板材3</option>
  	  		</select>
  	  		
  	  		<label  style="margin-left: 20px">公司:</label>  	  		
  	  		<select id="companySelect"  multiple="multiple"   name="companySelect">
  	  			<option  value="东北">东北</option>
  	  			<option  value="华北">华北</option>
  	  			<option  value="成都">成都</option>
  	  			<option  value="澳新">澳新</option>
  	  			<option  value="佛山">佛山</option>
  	  			<option  value="铝件厂">铝件厂</option>
  	  			<option  value="美非">美非</option>
  	  			<option  value="欧洲">欧洲</option>
  	  		</select>

 

 
jquery multiselect
 

 

 

 

你可能感兴趣的:(multiSelect)