根据选择第一个下拉框值,从第二个下拉框值中删除选项 [英] Remove options from second dropdown box value based on selecting first drop down box value

查看:96
本文介绍了根据选择第一个下拉框值,从第二个下拉框值中删除选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个具有相同值的下拉框...当我在第一个下拉选择一个值时,第二个下拉必须隐藏所选的值并显示剩下的第二个下拉...我正在获取使用php从表中下拉值...这可能是通过设计或使用查询???



//第一次下拉

I have two Drop down boxes with the same values on both... when i choose a value in 1st drop down , the second drop down must hide the chosen value and display remaining in the second drop down...am fetching drop down values from a table using php ...is this possible via design or using a query???

//1st drop down

<td><i><b>Rec_Series</b></i></td>
			<td><select id="rec" name="rec">
			 <?php     Show_Recseries($_POST['Region'],$brname[0]) ; ?>
			 </select>
			 </td>
			<script language="javascript">$('#rec').val("<?php echo $_POST['rec'];?>")</script>	







//第二次下拉





//2nd drop down

<td><i><b>Bill_Mac_id</b></i></td>
           <td><select id="brmacid" name="brmacid">
               <?php
                       Show_Mac_id($_POST['Region'],$brname[0]);
               ?>
       </select>
           </td>
           <script language="javascript">$('#brmacid').val("<?php echo $_POST['brmacid'];?>")</script>







有人可以帮我吗? 创建一个新的小提琴 - JSFiddle [ ^ ]



提前致谢



我尝试了什么:



我曾试图隐藏其他下拉并且真的很困惑..我需要更改功能还是我的PHP代码?




can someone help me out?? Create a new fiddle - JSFiddle[^]

Thanks in advance

What I have tried:

I had tried to hide other drop down and got really confused..Do I need to change in function or in my php code???

推荐答案

_POST [' Region' ],
_POST['Region'],


brname [0]); ?>
< / select >
< / td >
< script language = javascript >
brname[0]) ; ?> </select> </td> <script language="javascript">


' #rec')。val( <?php echo
('#rec').val("<?php echo


这篇关于根据选择第一个下拉框值,从第二个下拉框值中删除选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆