Click here to Skip to main content
15,920,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
HTML
<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

HTML
<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>



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???
Posted
Updated 23-Mar-16 1:30am
v3
Comments
Sinisa Hajnal 23-Mar-16 7:08am    
You could do it in your PHP code by rebinding after selection or in javascript/jQuery on select event.
alia007 23-Mar-16 7:10am    
can u explain with some JFiddle example

Can u help me to to rebind with jQuery ??

1 solution

http://jsfiddle.net/lshettyl/vrLr9wyg/

Cheers!!! Its working after using this!!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900