Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/01/2002, 11:31
Avatar de Kaopectate
Kaopectate
Colaborador
 
Fecha de Ingreso: diciembre-2001
Ubicación: Curaçao (Antillas Holandesas)
Mensajes: 3.179
Antigüedad: 22 años, 4 meses
Puntos: 38
Re: URGENTE!! Inhabilitar campos

Prueba esto:

<html>
<head>
<script language="JavaScript">
function manejaEvento(){
if (document.formulario.deshabilitar.value == "Deshabilitar"){
document.formulario.campoTexto.disabled = true;
document.formulario.deshabilitar.value = "Habilitar";
} else {
document.formulario.campoTexto.disabled = false;
document.formulario.deshabilitar.value = "Deshabilitar";
}
}
</script>
</head>
<body>
<form name="formulario">
<input type="text" name="campoTexto" value="algo">
<button name="deshabilitar" onclick="manejaEvento()">Deshabilitar </button>
</form>
</body>
</html>

Suerte!