Ver Mensaje Individual
  #3 (permalink)  
Antiguo 01/06/2009, 04:52
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 2 meses
Puntos: 574
Respuesta: Ayuda para deshabilitar un campo

Código HTML:
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
function inhabilita(obj){
	if(obj.value.length>0){
		document.getElementById("campo2").disabled=true;
	}else{
		document.getElementById("campo2").disabled=false;
	}
}
</script>
</head>
<body>
<input name="campo1" type="text" id="campo1" onChange="inhabilita(this)">
<br>
<input name="campo2" type="text" id="campo2">
</body>
</html> 
Mejor?

Quim