禁用回车键按 [英] Disable enter key press
本文介绍了禁用回车键按的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的页面中有一个webdatepicker控件。我必须限制Enter键按下事件,同时我手动输入日期。
我该怎么做。请帮我解决这个问题。
I have a webdatepicker control in my page. I have to restrict Enter key press event in it, while I enter date manually.
How can I do this. Please help me to solve this.
推荐答案
如果您使用的是jQuery,那么您可以执行以下操作
If you are using jQuery, then you can do the following
(' txtDate').bind(' keydown', function (e){
if (e.keyCode == 13 ){ // 如果按下ENTER键。
返回 false ;
});
('txtDate').bind('keydown', function(e) { if(e.keyCode == 13) { // If ENTER key is pressed. return false; });
如何防止输入密钥 [ ^ ]
检查链接..希望它会有所帮助..
How to Prevent Enter Key[^]
Check the link..hope it will help..
这篇关于禁用回车键按的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文