[英]capturing the enter key on textbox in asp.net for windows ce
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. 我想捕获Windows ce msie6.0的文本上的回车键,但是没有用于此的按钮,因此我不能对表单标签本身使用默认的按钮属性。 What else i can do to capture the Enter key?
我还可以做什么来捕获Enter键?
Thanks.. 谢谢..
I have used this function javascript in IE6, not sure if it will work in Windows CE 我已经在IE6中使用此功能javascript,不确定是否可以在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.
如果愿意,可以将其插入您选择的文本框中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.