我想在 html 中有 7 个下拉框。它们都将填充相同的数据。我想要做的是,当第一个下拉列表被选中时,它会从下一个下拉列表中删除选定的项目。所以,如果你有数字:A,B,C,D,E,F,G,H,I 在一个下拉列表中如果我在第一个下拉列表中选择 B 然后在下一个下拉列表中它应该只显示 A,C,D ,E,F,G,H,I 等最多 7 个下拉菜单。我不知道在 JavaScript 或 JQuery 中解决这个问题的最佳方法是什么。提前感谢您的帮助。
<table>
Selected Options: <div id="123"></div>
<tr>
<td class="assessmentHeader" align="left"><U> Diagnosis: - </U><br/> <!---Added code 88898 Created 7 dropdowns for Diagnosis 05/04/2012--->
<!---<font style="visibility:hidden"><textarea name="diagnosis" rows="2" cols="5" disabled="disabled">NULL</textarea></font><br/>--->
Primary : <select name="Primary" onchange="selected(this)">
<option value=""></option>
<cfloop query="DCheck">
<option value="#DCheck.cDescription#" >#DCheck.cDescription#</option></cfloop>
</select> <br/> <br/>
Secondary: <select name="Secondary" onchange="selected(this)">
<option value=""></option>
<cfloop query="DCheck">
<option value="#DCheck.cDescription#">#DCheck.cDescription#</option> </cfloop>
</select> <br><br />
Third : <select name="Third" onchange="selected(this)">
<option value=""></option>
<cfloop query="DCheck">
<option value="#DCheck.cDescription#">#DCheck.cDescription#</option></cfloop>
</select> <br><br/>
Fourth : <select name="Fourth" onchange="selected(this)">
<option value=""></option>
<cfloop query="DCheck">
<option value="#DCheck.cDescription#">#DCheck.cDescription#</option></cfloop>
</select> <br><br/>
Fifth : <select name="Fifth" onchange="selected(this)">
<option value=""></option>
<cfloop query="DCheck">
<option value="#DCheck.cDescription#">#DCheck.cDescription#</option></cfloop>
</select> <br><br/>
Sixth : <select name="Sixth" onchange="selected(this)">
<option value=""></option>
<cfloop query="DCheck">
<option value="#DCheck.cDescription#">#DCheck.cDescription#</option></cfloop>
</select> <br><br/>
Seventh : <select name="Seventh" onchange="selected(this)">
<option value=""></option>
<cfloop query="DCheck">
<option value="#DCheck.cDescription#">#DCheck.cDescription#</option></cfloop>
</select> <br><br />
</td>
</tr>
</table>