在 ASP.NET 应用程序中进行 Tab 键切换
我开发了一个asp.net应用程序。如果用户通过 Tab 键浏览我的应用程序的字段,然后继续超出末尾,则 Tab 键切换将在我的应用程序之外继续。其中包括用户输入 URL 的框,然后是其他一些框,包括用于输入搜索条件的 Google 框。然后最终它返回到我的应用程序的第一个字段。
如何将选项卡仅限于我的应用程序?
I have developed an asp.net application. If the user tabs through the fields of my application and then continues beyond the end, the tabbing continues outside my application. This includes the box where the user enters the URL, then some others including the Google box to enter search criteria. Then eventually it returns back to the first field of my application.
How do I limit the tabbing to my application only?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
处理这个问题最简单的方法就是不这样做。不要改变用户与自己的应用程序交互的方式。这是您无法也不应该控制的事情。 TAB 键具有明确定义的用户界面任务,其工作方式非常可预测。我没有使用过所有可用的浏览器,但我确信在 99% 的浏览器中,Tab 键允许用户在页面上和浏览器工具栏上的输入字段之间进行 Tab 键切换。如果你去改变这一点,你只会让用户感到沮丧。不使用鼠标的用户怎么办?残疾用户怎么办?
请在这里重新考虑您的设计决策。
The easiest way to handle this is to NOT do it. Do not change the way a user interfaces with their own applications. This is something you do not and should not have control of. The TAB key has a well-defined user interface task that works in a very predictable manner. I haven't used every browser available, but I am quite sure that in 99% of them, the tab key allows the user to tab between input fields on a page and on the browser's toolbar. If you go and change this you're only going to frustrate users. What about users who don't use a mouse? What about disabled users?
Please, re-think your design decision here.
我唯一能想到的是,如果您编写一些 JavaScript 可以捕获页面中最后一个字段上的
onkeydown
,测试它是否为 Tab 键,然后将焦点设置回第一个字段:The only thing that I can think of is if you wrote some javascript that could catch the
onkeydown
on the last field within your page, test for it being the tab key, and then set the focus back to the first field: