Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/02/2008, 15:36
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 23 años
Puntos: 772
Re: interacmbio de datos select multiple

Hola jorgedx

No se si te habré entendido bien Prueba esto:

Código PHP:
<html>
<
head>
<
script type="text/javascript">
function 
pasar() {
  
obj document.getElementById('sel1');
  
num obj.options.length;
  for (
i=num-1i>=0i--) {
    
txt=obj.options[i].text;
    
valor=obj.options[i].value;
    
obj.options[i]=null;
    
obj2=document.getElementById('sel2');
    
opc = new Option(txt,valor);
    eval(
obj2.options[i]=opc);
  }  
}
</script>
</head>
<body>
<select id="sel1" size="5" multiple="multiple">
<option value="1">Uno</option>
<option value="2">Dos</option>
<option value="3">Tres</option>
<option value="4">Cuatro</option>
<option value="5">Cinco</option>
</select>
<select id="sel2" size="5">
</select>
<input type="button" onclick="pasar()" />
</body>
</html> 
Saludos,