我的场景是这样的
我需要创建一个出勤列表,所以我为此使用了两个 jQuery 选择框(多选下拉菜单)。
一个用于出席的人,另一个用于缺席的人。我想要的是当我从参加人员选择框中选择特定人员时,他们不能在缺席人员选择框中可用。有人可以帮帮我吗?
这是我的编码段
<section>
<label for="text_field">Attended People</label>
<div>
<select data-placeholder="Select Employees" class="chzn-select" id="employees" multiple="true" style="width:350px;" tabindex="4" name="employees[]">
<?php
$query2 = "SELECT * FROM `employee` WHERE `company_id`= $compnay_id";
$sql_result2 = mysql_query($query2);
while ($row2 = mysql_fetch_assoc($sql_result2)) {
?>
<option value="<?php echo $row2['id']; ?>"><?php echo $row2['name']; ?></option>
<?php } ?>
</select>
</div>
</section>
<section><label for="text_field">Absented People</label>
<div>
<select data-placeholder="Select Employees" class="chzn-select" id="employees2" multiple="true" style="width:350px;" tabindex="4" name="employees2[]">
<?php
$query2 = "SELECT * FROM `employee` WHERE `company_id`= $compnay_id";
$sql_result2 = mysql_query($query2);
while ($row2 = mysql_fetch_assoc($sql_result2)) {
?>
<option value="<?php echo $row2['id']; ?>"><?php echo $row2['name']; ?></option>
<?php } ?>
</select>
<script type="text/javascript">
$(".chzn-select").chosen();
$(".chzn-select-deselect").chosen({allow_single_deselect: true});
$("")
</script>
</div>
</section>