在Windows CE中捕获asp.net中文本框上的Enter键 [英] capturing the enter key on textbox in asp.net for windows ce

查看:104
本文介绍了在Windows CE中捕获asp.net中文本框上的Enter键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为Windows ce msie6.0捕获文本上的回车键,但是没有用于此的按钮,因此我不能对表单标签本身使用默认的button属性.我还能做些什么来捕捉Enter键?

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?

谢谢..

推荐答案

我已经在IE6中使用了此功能javascript,不确定是否可以在Windows CE中使用

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>

此功能捕获所有字段中的输入.如果愿意,可以将其插入您选择的文本框中.

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

这篇关于在Windows CE中捕获asp.net中文本框上的Enter键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆