<input type="text" onkeyup="if(event.keyCode==13)this.value=''"/>

解决方案 »

  1.   

    <script language="javascript">

    function keydown()
    {
    if(event.keyCode==13)
    {
    document.all["hidPage"].value=document.all["txt"].value;
    document.all["txt"].value="";

    alert(document.all["hidPage"].value);
    document.all["txt1"].focus();
    } }
    </script>
    <body onload="document.all.txt.focus();">
    <input type="hidden" name="hidPage">
    <table>
    <tr>
    <td>
    <input type=text name=txt id=txt onkeydown="keydown()">
    </td>
    <td>
    <input type=text name=txt1 id=txt1 onkeydown="keydown()">
    </td> </tr>
    </table>
    我这样写在一般的页面可以怎么一到控件页面就不行呢?
      

  2.   

    是我在.net中自定义的一个控件
      

  3.   

    .net 中使用
     textBox控件ID.Attributes.Add("onkeyup","if(event.keyCode==13)this.value=''")