Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Select</title>
  5. </head>
  6. <body>
  7. <center>
  8.  
  9.  
  10. <select style="width:150px; height: 100px;" name="lista_izquierda" multiple="multiple" size="4" id="lista_izquierda">
  11. <option value="1">Volvo</option>
  12. <option value="2">Mazda</option>
  13. <option value="3">Chevrolet</option>
  14. <option value="4">KIA</option>
  15. <option value="5">Ford</option>
  16. </select>
  17.  
  18. <input type="button" onclick="PasarParametro('lista_izquierda','lista_derecha')" value="PASAR" />
  19. <input type="button" onclick="PasarParametro('lista_derecha','lista_izquierda')" value="REGRESAR"/>
  20.  
  21. <select style="width:150px; height: 100px;" name="lista_derecha" multiple="multiple" size="4" id="lista_derecha">
  22. </select>
  23.  
  24.  
  25.  
  26.  
  27. </center>
  28. </body>
  29. <script type="text/javascript">
  30.  
  31. function PasarParametro(origen_id, destino_id){
  32. obj = document.getElementById(origen_id);
  33. if(obj.selectedIndex == -1){
  34. return;
  35. }
  36. valor = obj.value;
  37. txt = obj.options[obj.selectedIndex].text;
  38. obj.options[obj.selectedIndex] = null;
  39. obj2 = document.getElementById(destino_id);
  40. opc = new Option(txt, valor);
  41. eval(obj2.options[obj2.options.length] = opc);
  42. return false;
  43. }
  44. </script>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement