Ver Mensaje Individual
  #9 (permalink)  
Antiguo 02/06/2009, 00:44
OverCrash
 
Fecha de Ingreso: enero-2008
Ubicación: Manresa
Mensajes: 24
Antigüedad: 17 años
Puntos: 0
Respuesta: problemas con document.getElementById

Eres el mejor!!! 100% funcionando.

Os dejo el codigo de como ha quedado, por si a alguno le puede ser útil.

Código:
function AddToSecondList(){
	var fl = document.getElementById("firstlist");
	var sl = document.getElementById("secondlist");    
	for (i = 0; i < fl.options.length; i++){
		if(fl.options[i].selected){
			var nuevaOpcion = new Option(fl.options[i].text,fl.options[i].value,null,"selected"); 
			document.getElementById("secondlist").options.add(nuevaOpcion);	
			document.getElementById("firstlist").options[i] = null;
		}
	}
	return true;
}

function DeleteSecondListItem(){
	var fl = document.getElementById("firstlist");	
	var sl = document.getElementById("secondlist");    
	for (i = 0; i < sl.options.length; i++){
		if(sl.options[i].selected){
			var nuevaOpcion = new Option(sl.options[i].text,fsl.options[i].value,null,"selected"); 
			document.getElementById("firstlist").options.add(nuevaOpcion);	
			document.getElementById("secondlist").options[i] = null;
		}
	}
	return true;
}
Saludos y muchas gracias!!!