Por dar gusto y seguir jugando con este código he implantado la posibilidad de qe esté disabled o que no lo esté:
Código:
<html>
<head>
<script>
texto="";
var z=0;
function anadir(letra){
texto=barra.value;
texto=texto+letra;
barra.value=texto;
}
function habilitar(){
z=z+1
if(z==1){barra.disabled=true;z=-1}
else{barra.disabled=false}
}
</script>
</head>
<body style="font:normal 10px/10px verdana">
<input type="Text" name="barra" style="width:300px;border:solid 1px black" ><br>
<input type="checkbox" name="habilitado" onchange="habilitar()" value="" >Protegido contra escritura directa?
<br>
<br>
<br>
<br>
<br><div id="botones" style="font:normal 8px/4px verdana"></div>
<script>
var letras="";
var p=0;
for (a=65;a<91;a++){
letras=letras+"<input style='width:20px;heiht:20px;' type='Button' value=&#"+a+" onclick=anadir('&#"+a+"')> ";
p=p+1;
if(p==9){p=0;letras=letras+"<br><br>";}
}
botones.innerHTML=letras+"<input style='width:20px;heiht:20px;' type='Button' value=© onClick=alert('KarlanKas-2002')><br><br><input style='width:205px;height:22px;' type='Button' value='espacio' onclick=anadir(' ')>";
</script>
</body>
</html>