Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/05/2007, 07:55
Avatar de derkenuke
derkenuke
Colaborador
 
Fecha de Ingreso: octubre-2003
Ubicación: self.location.href
Mensajes: 2.665
Antigüedad: 20 años, 7 meses
Puntos: 45
Re: Ayuda.. con javascript

Estoy intentando descubrir por qué no funciona en IE...

Código PHP:
<select multiple="multiple" onclick="handler(this)" size="5">
    <
option>Uno</option>
    <
option>Dos</option>
    <
option>Tres</option>
    <
option>Cuatro</option>
    <
option>Cinco</option>
</
select>

<
script>


/*
function e(q,noBr) {
    document.body.appendChild( document.createTextNode(q) );
    if(!noBr) document.body.appendChild( document.createElement("BR") );
}*/

function handler(sel) {
    var 
opt=sel.options[sel.options.selectedIndex];
    if( 
opt.getAttribute("seleccionado")!= "si" )
        
opt.setAttribute("seleccionado","si");
    else
        
opt.setAttribute("seleccionado","no");
    for( var 
i=0i<sel.options.lengthi++) 
        if( 
sel.options[i].getAttribute("seleccionado")=="si" )
            
sel.options[i].selected=true;
        else
            
sel.options[i].selected=false;
    return 
false;
}


</script> 
Si lo ves me dices.. esto frustra mucho.
__________________
- Haz preguntas inteligentes, y obtendrás más y mejores respuestas.
- Antes de postearlo Inténtalo y Búscalo.
- Escribe correctamente tus mensajes.