理论上是不可能的,
不过...
可以<input type=text id=theID onkeypress="return false">但是如果用户copy就没办法了当然可以用<input type=text id=tID onkeypress="return false" style="visibility: hidden">来让他无法看见(当然也就没法用了)
用 
tID.style.visibility="visible"  显示
tID.style.visibility="hidden"   隐藏  (注意:依然要占据页面空间)

解决方案 »

  1.   

    <form name="myform">
    <input type="text" name="myinput">
    ...
    </form>
    <script>
    document.myform.myinput.readOnly = true;
    //or
    //document.myform.myinput.disabled = true;
    </script>
      

  2.   

    <input type="text" name="myinput" disabled>
      

  3.   

    <input disabled="true"> or <input readonly>
    readonly的对象的值可以随form一起被提交,而disabled是不能被提交的。
      

  4.   

    人工智能不要乱说。
    <form name=form1>
    <input type=text name=text1 >
    </form>
    <script langauge=javascript>
     document.form1.text1.disabled=true
    </script>
      

  5.   

    to hellojw()
    : 是用 Javascript 控制,呵 ^o^document.formname.buttonname.disabled=true; //不可用
    document.formname.buttonname.disabled=false; //可用
      

  6.   

    教你一个更cool的方法!<html>
    <head>
    <title>新建网页 1</title>
    </head><body>
    教你一个更cool的方法!<br>
    <input type=text id=t1 value="变料吗?" size="20"><br>
    下面两个onclick函数对应两个按钮的onclick事件
    <script>
    function onclick1()//input变成文字
    {
      if (document.all.t1.tagName == "INPUT")
      {
        document.all.t1.outerHTML = "<FONT id = t1>" +  document.all.t1.value + "</FONT>";
      }
    }
    function onclick2()//文字变成input
    {
      if (document.all.t1.tagName == "FONT")
      {
        document.all.t1.outerHTML = "<input type=text name=t1 value=" + document.all.t1.innerText + ">";
      }
    }
    </script>
    <input type="button" value="编辑框变文字" onclick = onclick1()><input type="button" value="文字变编辑框" onclick = onclick2()>
    </body>
    </html>