JavaScript - como desahibilitar un selct box

 
Vista:

como desahibilitar un selct box

Publicado por Cesar (1 intervención) el 03/11/2007 22:04:06
Buenas ,tengo un codigo similar al que muestro en la parte inferior,lo que quiero es que cuando elija un select box ,se deshabiliten los otros que se encuentran en mi formulario.Gracias por anti cipado.
----------------------------------------------------------------------------------------------------------------------------------------
<html>
<head>
<script>
function elegir(este){
combos=document.getElementsByTagName("SELECT");
for(a=0;a<combos.length;a++){
combos[a].disabled=(combos[a].name!=este.name)?true:false;
}
}
</script>
<title>Untitled</title>
</head>

<body>
<select name="pepe" size="1" onchange="elegir(this)">
<option value="1" SELECTED>Elige</option>
<option value="2">1</option>
<option value="3">2</option>
<option value="4">3</option>
</select>
<br>
<select name="pepe1" size="1" onchange="elegir(this)">
<option value="1" SELECTED>Elige</option>
<option value="2">1</option>
<option value="3">2</option>
<option value="4">3</option>
</select>
<br>
<select name="pepe2" size="1" onchange="elegir(this)">
<option value="1" SELECTED>Elige</option>
<option value="2">1</option>
<option value="3">2</option>
<option value="4">3</option>
</select>
<br>
<select name="pepeeee" size="1" onchange="elegir(this)">
<option value="1" SELECTED>Elige</option>
<option value="2">1</option>
<option value="3">2</option>
<option value="4">3</option>
</select>
<br>

</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:como desahibilitar un selct box

Publicado por César (7 intervenciones) el 05/11/2007 11:59:47
El codgo funciona correcto, cual es tu duda?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar