我正在使用SumoSelect下拉列表来选择多项选项。但我无法在PHP中获取所选的值数组。当我 var_dump 数据时,我得到 NULL ..下面是我到目前为止所做的代码..
HTML
<form action="" method="POST">
<select name="industry[]" id="industry" style="width:305px;" multiple="multiple" placeholder="Choose Industry" class="SlectBox">
<option value="" disabled="disabled" selected>-- Choose Industry<span style="color:red; margin-left:2px;">*</span> -- </option>
<option value="Agriculture & Food">Agriculture & Food</option>
<option value="Apparel, Textiles & Accessories">Apparel, Textiles & Accessories</option>
<option value="Auto & Tranportation">Auto & Tranportation</option>
<option value="Bags, Shoes & Accessories">Bags, Shoes & Accessories</option>
<option value="Electronics">Electronics</option>
<option value="Electrical Equipment, Components & Telecoms">Electrical Equipment, Components & Telecoms</option>
<option value="Gifts, Sports & Toys">Gifts, Sports & Toys</option>
<option value="Health & Beauty">Health & Beauty</option>
<option value="Home, Lights & Construction">Home, Lights & Construction</option>
<option value="Machinery, Industrial Parts & Tools">Machinery, Industrial Parts & Tools</option>
<option value="Metallurgy, Chemicals, Rubber & Plastic">Metallurgy, Chemicals, Rubber & Plastic</option>
<option value="Packaging, Advertising & Office">Packaging, Advertising & Office</option>
</select>
</form>
的Javascript
<script type="text/javascript">
$(document).ready(function () {
window.asd = $('.SlectBox').SumoSelect({ csvDispCount: 3 });
});
</script>
PHP
$values = $_POST['industry'];
var_dump($values);
但是当我 var_dump
时,我会收到 NULL
。我不知道是什么问题。请帮帮我。提前谢谢。