Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/05/2012, 11:01
vmoran2009
 
Fecha de Ingreso: febrero-2011
Mensajes: 43
Antigüedad: 13 años, 3 meses
Puntos: 0
select multiple no funciona solo en internet explorer

hola amigos, este codigo es una combinación de javascript y php me funciona correctamente en firefox y google chrome, sin enmbargo en internet explorer me falla me marca tipo incorrecto en la siguiente linea

sl.add(fl.options[i],null);

que puede ser lo que esta malo, mucho agradecere me puedan ayudar a corregir el problema, gracias y saludos

<html>

<head>



<style type="text/css">

select {

width: 200px;

height: 130px;

background-color: #FFCC66;

color: #000;

}



</style>



<script type="text/javascript">

function AddToSecondList(){

var fl = document.getElementById('firstlist');

var sl = document.getElementById('secondlist');

for (i = fl.options.length-1; i >= 0; i--){

if(fl.options[i].selected){

sl.add(fl.options[i],null);

}

}

return true;

}



function DeleteSecondListItem(secondlist){

var fl = document.getElementById('firstlist');

var sl = document.getElementById('secondlist');

for (i = sl.options.length-1; i >= 0; i--){

if(sl.options[i].selected){

// paso los valores seleccionados al primer list multiple

fl.add(sl.options[i],null);



}

// marco nuevamente el resto de valores que no serán eliminados

// pero que será procesados por al enviar el formulario

sl.options[i].selected = true;

}



return true;

}

</script>



</head>

<body>

<form name="f1" action="" method="post">

RESULTADOS NO ASIGNADOS

<div>

<select name="noasignados[]" id="firstlist" multiple="multiple" style="select1">

<option value = 1>1-Normal</option><option value = 2>2-Negativo</option><option value = 3>3-Anormal</option><option value = 4>4-Positivo</option><option value = 5>5-Muestra Inadecuada</option><option value = 6>6-Otros</option>

</select>

</div>

&nbsp;



<input type="button" value="&rarr;" onclick="AddToSecondList();" />

<input type="button" value="&larr;" onclick="DeleteSecondListItem();" />

<BR />

<br />

RESULTADOS ASIGNADOS

<div>

<select name="asignados[]" id="secondlist" multiple="multiple" style="select2">

</select>

</div>





<input type="submit" name="enviar" value="Enviar datos!" >

</form>

</body>

</html>