如何在asp.net中的位置选项卡中使用Enter键 [英] how to use enter key in the place tab key in asp.net

查看:65
本文介绍了如何在asp.net中的位置选项卡中使用Enter键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有两个文本框,当我按下Enter键时,第一个textbox1中的第一个iam会自动使指针指向第二个文本框,如何工作

i have two text boxes in my appilication,first iam in first textbox1 when i pressed enter key that pointer will automatically focius to second text box ,how to this work

推荐答案

那是一个非常糟糕的主意.
Enter不是用户希望用来在各个框之间切换的键-他希望它提交表单,或按一个按钮,或在文本框中开始新行.

如果您确实实现了这一点,那么您将感到困惑,并激怒了希望具有特定行为的用户,并且必须记住您的应用程序是不同的".总的结果取决于用户的专业知识水平:

高:删除该应用,然后对生产它的公司大喊.
中:记录行为,以便他们能够记住并互相抱怨此应用程序无用.
低:停止使用该应用.

请不要远离已建立的用户界面标准-它们之所以被称为标准",是有原因的!如果我的一个应用程序使用CTRL-C进行清除"并将复制"移动到CTRL-Z,您会感到满意吗?
That is a very bad idea.
Enter is not a key that the user expects to use to go from box to box - he expectes it to submit the form, or press a button, or start a new line in a textbox.

If you do implement this, then you are going to confuse, and annoy users who expect a particular behaviour, and have to remember that your application is "different". The general result of this depends on the users expertise level:

High: Delete the app, yell at the company that produced it.
Medium: write down the behaviour so they can try to remember, and complain to each other that this app is useless.
Low: Stop using the app.

Please, do not go away from established user interface statndards - they are called "standards" for a reason! Would you be happy if one of my apps used CTRL-C for "Clear" and moved Copy to CTRL-Z?


尽管这违反了约定的使用标准,但您要求许多人曾经问过的问题.


把它放在头上:
Whilst it is against the agreed standards of use, you are asking a question many have asked before.


Put this in the head:
<script language="javascript" type="text/javascript">

    function EnterTab(e) {
        var intKey = window.Event ? e.which : e.KeyCode;


        if(intKey == 13)
            e.returnValue = false;
    }
</script>




并在正文标签中:




And in the body tag:

<body onkeydown="EnterTab(event);">


请参阅以下链接

http://forums.asp.net/t/1088853. aspx/1?make + enter + key + work + as + tab + [ http://bytes.com/topic/javascript/answers/485036- javascript-change-enter-key-tab-keypress [ ^ ]
Refer these links

http://forums.asp.net/t/1088853.aspx/1?make+enter+key+work+as+tab+[^]

http://bytes.com/topic/javascript/answers/485036-javascript-change-enter-key-tab-keypress[^]


这篇关于如何在asp.net中的位置选项卡中使用Enter键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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