Ver Mensaje Individual
  #12 (permalink)  
Antiguo 15/11/2007, 21:00
Avatar de Shiryu_Libra
Shiryu_Libra
Colaborador
 
Fecha de Ingreso: febrero-2007
Ubicación: Cantando "Screenager" en "Kirafa Kaput"
Mensajes: 3.614
Antigüedad: 17 años, 2 meses
Puntos: 88
Re: Qué es esto?? Cómo se hace?

aki de nuevo

script:
Cita:
<script type="text/javascript">
<!--
function pasar(de,para) {
var obj=document.getElementById(de);
var obj2=document.getElementById(para);

if (obj.selectedIndex==-1) return;
for (i=0; opt=obj.options[i]; i++)
if (opt.selected) {
valor=opt.value; // almacenar value
txt=obj.options[i].text; // almacenar el texto
obj.options[i]=null; // borrar el item si está seleccionado
if (obj.options.length==0)
{
opc1 = new Option("-","-");
eval(obj.options[obj.options.length]=opc1);}


if (obj2.options[0].value=='-'){ // si solo está la opción inicial borrarla
obj2.options[0]=null;}


opc = new Option(txt,valor);
eval(obj2.options[obj2.options.length]=opc);
obj=null;obj2=null;valor=null;txt=null;
}
}
--></script>
Cita:
<label for="sel1">Origen:</label>
<select id="sel1" size="10" style="width:100px;">
<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>
<input type="button" onclick="pasar('sel1','sel2')" value="Agregar"/>
<input type="button" onclick="pasar('sel2','sel1')" value="Quitar"/>
<label for="sel2">Destino:</label>
<select id="sel2" size="10" style="width:100px;">
<option value='-'>-</option>
</select>
Esperemos que ahora si funcione como es debido, Saludos Carxl, JavierB
__________________
"Eres parte del problema, parte de la solucion o parte del paisaje"
Un Saludo desde Desierto de Altar, Sonora, MX.
Shiryu_libra