Ver Mensaje Individual
  #8 (permalink)  
Antiguo 31/05/2009, 15:27
Avatar de chiquirf
chiquirf
 
Fecha de Ingreso: noviembre-2005
Ubicación: Madrid
Mensajes: 215
Antigüedad: 19 años, 4 meses
Puntos: 3
Respuesta: deshabilitar option

a Mi no me funciona en IE.... alquien me puede ayudar????

Esto es lo que hago:

Código PHP:
<html>
<
head>

<
script language="javascript" type="text/javascript">
<!--

function 
cond_1(){

    
frm document.Form1;
    
ord frm.p1.selectedIndex;
    
alert("has seleccionado la opcion: " +ord);
    switch(
ord) {
    
        case 
0:
            break;
        case 
1:
            
frm.p2[1].readonly "readonly";
            
frm.p2.options[2].disabled true;
            
document.getElementById("p2")[3].disabled true;
            
document.getElementById("p2").options[4].disabled true;
            
            
//frm.p2.p2e.disabled = true;
            
document.getElementById("p2e").disabled true;
            
            
frm.p2[6].disabled false;
            
frm.p2.options[7].disabled false;
            
            
            
            break;
        case 
2:
            
frm.p2[1].disabled false;
            
frm.p2.options[2].disabled false;
            
document.getElementById("p2")[3].disabled false;
            
document.getElementById("p2").options[4].disabled false;
            
frm.p2[6].disabled true;
            
frm.p2.options[7].disabled true;
            
            break;
    }
}

-->
</script>

</head>


<body>
<form id="Form1" name="Form1" method="post" action="">

<select name="p1" id="p1" onchange="javascript:cond_1(this.value);">
    <option value="" selected="selected"></option>
    <option value="1">opcion 1</option>
    <option value="2">opcion 2</option>
</select>

<br>
<br>
<select name="p2" id="p2">
    <option value="" selected="selected"></option>
    <option id="p2a" name="p2a" value="1">opcion 1</option>
    <option id="p2b" name="p2b" value="2">opcion 2</option>
    <option id="p2c" name="p2c" value="3">opcion 3</option>
    <option id="p2d" name="p2d" value="4">opcion 4</option>
    <option id="p2e" name="p2e" value="5">opcion 5</option>
    <option id="p2f" name="p2f" value="6" disabled="disabled">opcion 6</option>
    <option id="p2g" name="p2g" value="7" disabled="disabled">opcion 7</option>
</select>

</form>

</body> 

</html> 
saludos

gracias
__________________
=================
Chiqui nunca muere ! ! !