ahmed salah

ahmed salah

  • NA
  • 530
  • 148.4k

How to add one row from two drop down to table and remove

Jul 21 2016 11:23 AM

  1. @{  
  2.     Layout = null;  
  3. }  
  4.   
  5. <!DOCTYPE html>  
  6.   
  7. <html>  
  8. <head>  
  9.     <meta name="viewport" content="width=device-width" />  
  10.     <title>Index</title>  
  11.     <script src="~/Scripts/jquery-1.10.2.js"></script>  
  12.     <script>  
  13.          
  14.     </script>  
  15. </head>  
  16. <body>  
  17.     <div>   
  18.         Project : <select id="myproject">  
  19.             <option value="1">one</option>  
  20.             <option value="2">two</option>  
  21.             <option value="3">three</option>  
  22.             <option value="4">four</option>  
  23.         </select><br />  
  24.         Employees : <select id="myemployee">  
  25.             <option value="1">ahmed</option>  
  26.             <option value="2">mohamed</option>  
  27.             <option value="3">saiad</option>  
  28.             <option value="4">adil</option>  
  29.         </select>  
  30.     </div>  
  31.     <table id="tb">  
  32.         <tr><td>ProjectName</td><td>EmployeeName</td></tr>  
  33.     </table>  
  34. </body>  
  35. </html>  
 How to add one row from two drop down list to table and remove when select
I have two drop dow list
first for projects
second for employees
I need when select value from first drop down list(projects) then select value from second drop down list (employee)
add new row of selected value from both two drop down list to table as following
suppose i select
one  adil
value selected removed from two drop dow list both and inserted in table
my code as following

How i do that by jquery



Answers (3)