Jquery检查是否选中了选择框

时间:2015-04-27 13:05:12

标签: jquery select

我有3个选择框:

<div class="widget mm_select">
    <label for="ctrl_Customers_Region">Region</label>   <select name="Customers_Region" id="ctrl_Customers_Region" class="select"><option value="">No filtering</option><option value="emea" selected="">EMEA</option><option value="america">America</option><option value="apac">APAC</option><option value="global">Global</option></select></div>

<div class="widget mm_select ">
    <label for="ctrl_Customers_Branche">Business</label>    <select name="Customers_Branche" id="ctrl_Customers_Branche" class="select"><option value="">No filtering</option><option value="retail-fashion">Retail - Fashion</option><option value="retail-consumer-electronics">Retail - Consumer Electronics</option><option value="retail-digital-goods">Retail - Digital Goods</option><option value="retail-furniture">Retail - Furniture</option><option value="retail-other">Retail - Other</option><option value="manufacturing-automotive">Manufacturing - Automotive</option><option value="manufacturing-pharmaceuticals-chemicals">Manufacturing - Pharmaceuticals / Chemicals</option><option value="manufacturing-high-tech">Manufacturing - High-Tech</option><option value="manufacturing-other">Manufacturing - Other</option><option value="utilities-and-telco-utilities">Utilities and Telco - Utilities</option><option value="utilities-and-telco-telco">Utilities and Telco - Telco</option><option value="food-grocery-and-equipment">Food - Grocery and Equipment</option><option value="media-entertainment-and-publishing">Media, Entertainment, and Publishing</option><option value="b2b-and-distribution">B2B and Distribution</option></select></div>

如果选择了3个选择框中的任何一个,我该如何检查?

THX

1 个答案:

答案 0 :(得分:2)

您可以找到已选择且没有值的选项&#34;&#34;:

 if($('select option:selected[value!=""]').length ) { 
    //more than one select box is selected
 }