¿Y no sería mejor con un checkbox?
Código:
<html>
<head>
<title>Untitled Document</title>
<style>
body,TD,INPUT{font:bold 10px/12px verdana;color:black;}
#txt{border:solid 1px black;width:200px;}
</style>
<script language="JavaScript">
function deshabilita(opcion){
if (opcion.checked){
document.formulario.txt.value = "";
document.formulario.txt.style.background = "#e0e0e0";
document.formulario.txt.disabled = true;
}
else{formulario.txt.disabled = false;
document.formulario.txt.style.background = "#ffffff";
}}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table><tr>
<form name="formulario">
<td>
<input type="text" id="txt" name="txt" ></td></tr>
<tr>
<td>
<input type="checkbox" name="conectado" onchange="deshabilita(this)">Deshabilitado</td>
</tr>
</form>
</table>
</body>
</html>