当光标位于最后一个文本框中并按Tab键时,如何聚焦于第一个文本框'tabindex = 1' [英] How do I focus on the first textbox 'tabindex=1' when the cursor is in the last textbox and i press the tab key

查看:104
本文介绍了当光标位于最后一个文本框中并按Tab键时,如何聚焦于第一个文本框'tabindex = 1'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

向所有朋友问好

我有一个用于注册用户的页面,带有多个标签和文本框,两个按钮一个用于提交,另一个按钮用于取消.我将第一个文本框的tabindex的"txtFname" ID设置为"tabindex = 1",并将文本框的tabindex的结尾以"txtPass" ID为"tabindex = 14".我想当tabindex = 14然后按Tab键时,将焦点集中到第一个文本框即txtFname".
如何使用javascript做到这一点?

我正在使用asp.net和c#.

Hello to all friends

i have a page for register users with several label and textbox and two button that one for submit and other one for cancel.i set first textbox tabindex with "txtFname" ID to "tabindex=1" and to end textbox tabindex with "txtPass" ID to "tabindex=14".i want to, when tabindex=14 and then key tab press,focus to first textbox "i.e txtFname".
how to do this with javascript?

i''m working with asp.net and c#.

tanx in advance.

推荐答案

尝试一下...
将此代码放在适当的位置...

TextBox1.Focus();
try this...
put this code in the appropriate place...

TextBox1.Focus();


这篇关于当光标位于最后一个文本框中并按Tab键时,如何聚焦于第一个文本框'tabindex = 1'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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