Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/08/2004, 03:59
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 3 meses
Puntos: 772
Hola, ferent.

Te he hecho un ejemplo con unos campos de texto y utilizo el atributo class para diferenciar los 2 que hay que habilitar/deshabilitar:
Código HTML:
<html>
<head>
<script>
function habilitar(obj,opc) {
	for(i=0;i<obj.elements.length;i++)
		if(obj.elements[i].className=='hab')
			obj.elements[i].disabled=opc;
}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<form>
Si <input type="radio" name="rad" onclick="habilitar(this.form,false)" />
No <input type="radio" name="rad" onclick="habilitar(this.form,true)" />
<input type="text" class="hab" />
<input type="text" />
<input type="text" class="hab" />
</form>
</body>
</html> 
Lo he puesto con un radiobutton, como dices en tu mensaje, pero ¿no preferiría utilizar un checkbox?

Espero que te sirva. Saludos,