capturing the enter key on textbox in asp.net for windows ce

╄→尐↘猪︶ㄣ 提交于 2019-12-12 03:21:40

问题


I want to capture the enter key on text for windows ce msie6.0 but there is no button for that so i cannot use default button property for the form tag itself. What else i can do to capture the Enter key?

Thanks..


回答1:


I have used this function javascript in IE6, not sure if it will work in Windows CE

    <script language="javascript">
    document.onkeydown = myOnkeydown;  
    function myOnkeydown()
    {        
        var key = window.event.keyCode;
        if (key == 13) { //13 is the keycode of the 'Enter' key
           //do stuff
        }
    }
    </script>

Edit: This function captures the input in all fields. You can plug it to the textbox of your choice if you like.



来源:https://stackoverflow.com/questions/561782/capturing-the-enter-key-on-textbox-in-asp-net-for-windows-ce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!