不积跬步,无以至千里;不积小流,无以成江海

Our practice

不积跬步,无以至千里;不积小流,无以成江海

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
页面中响应回车键代码:
JS:
 1function enterSubmit(src,e)
 2     {
 3        if(window.event)
 4            keyPressed = window.event.keyCode; // IE
 5        else
 6            keyPressed = e.which; // Firefox
 7        if(keyPressed==13)
 8        
 9            submitForm();            
10           return false;
11        }

12    }

13    function submitForm()
14    {
15        var obj = document.getElementById('MyMaster_DemoPageInput_goButton');                      
16        obj.click();                 
17    }
HTML:
<asp:TextBox ID="keyinput"onkeydown="return enterSubmit(this,event);" runat="server"></asp:TextBox>

posted on 2008-06-17 15:47  英怀  阅读(5443)  评论(0编辑  收藏  举报