代码:
<select data-placeholder="Click and Select Menu For Assign..." multiple class="chosen-select form-control" name="assign[]">
<?php
$main_menu = explode(",",$menu);
foreach($main_menu as $fetch)
{
?>
<option value="<?php echo $fetch; ?>"<?=($fetch==$fetch)? 'selected="selected"':''?>></option>
<?php
}
?>
<option value="null" style="color:red;">Select Menu For Assign</option>
<?php
$sql = "select menu from assign";
$result = mysqli_query($con,$sql);
while($row = mysqli_fetch_array($result))
{
echo "<option value='".$row['menu']."'>".$row['menu']."</option>";
}
?>
</select>
在此代码中,我创建了多选下拉列表。现在我想在aaa bbb ccc之类的多选下拉列表中获取值,但现在看起来就像我们在简单的下拉列表中看到的那样。那么,我该如何解决这个问题呢?请帮帮我。
谢谢