Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/01/2007, 08:57
Alexcivan
 
Fecha de Ingreso: enero-2003
Ubicación: Zaragoza
Mensajes: 217
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: Problemas con 2 select

Sería algo así:

Código HTML:
<html> 
<head> 
<script type="text/javascript"> 
function pasar() { 
    obj=document.getElementById('sel1'); 
    if (obj.selectedIndex==-1) return; 
    valor=obj.value; 
    txt=obj.options[obj.selectedIndex].text; 
    obj2=document.getElementById('sel2'); 
    opc = new Option(txt,valor); 
    eval(obj2.options[obj2.options.length]=opc);     
} 
function quitar() { 
    obj=document.getElementById('sel2'); 
    if (obj.selectedIndex==-1) return; 
    valor=obj.value; 
    txt=obj.options[obj.selectedIndex].text; 
    obj.options[obj.selectedIndex]=null; 
} 

</script> 
</head> 

<body> 
<select id="sel1" size="5"> 
<option value="1">Una ciudad</option> 
<option value="2">Otra ciudad</option> 
<option value="3">Mas cosas</option> 
<option value="4">poblaciones varias</option> 
<option value="5">varias poblaciones</option> 
</select>
<input name="button2" type="button" onClick="pasar()" value="Pasar">
<input name="button" type="button" onClick="quitar()" value="Quitar">
<select id="sel2" size="5"> 
</select> 
<br>
</body> 
</html> 
Faltaría poner un formulario y la página para recogerlo, me gustaría recoger "sel2" pero con $_POST[sel2] solo se recoge el valor seleccionado y yo quiero recoger todos
__________________
Diseño web Zaragoza