第2个问题可以使用onKeyUp函数截获
第3个问题可以在使用onKeyUp函数截获回车时候,将该文本框的value属性设为"",然后使用focus函数将焦点聚焦在该文本框。
<input type="text"  name="xx"  value="">
<script>
function  getEnter(){
  if(window.event.keyCode==13){
    document.all.xx.value="";
    document.all.xx.focus();
  }
}
</script>

解决方案 »

  1.   

    不好意思代码发错了,是使用Onkeydown事件,重新发下
    <input   type="text"     name="xx" value="" Onkeydown="getEnter();"> 
    <script> 
    function     getEnter(){ 
        if(window.event.keyCode==13){ 
            document.all.xx.value=""; 
            document.all.xx.focus(); 
        } 

    </script> 
      

  2.   

    非常感谢!
    问题全部解决。
    但是发现document.all在FireFox里面会报警。
      

  3.   

    document.all是ie4+以上的,ff不支持如果需要支持ff,请改为document.getElementById("控件的id")
      

  4.   

    而且2-3楼的event对象传递不正确.......
    <input type="text" id="xx" name="xx" value="" onkeydown="getEnter(event)">   
    <script>   
    function getEnter(e){   
      e=e||event;
      if(e.keyCode==13){   
        document.getElementById("xx").value="";   
        document.getElementById("xx").focus();   
      }   
    }  
    </script>