登录表单中没有工作Tab键 [英] Not working Tab key in login form
本文介绍了登录表单中没有工作Tab键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
我有用于验证用户的登录表单,当我使用用户名文本框上的按键时,我使用脚本来关注密码文本框。
Dear All,
I have login form for authenticate user, I am using script to focus to password textbox when use press key on username textbox.
function Focus(e) {
alert(e.keyCode);}
<asp:TextBox ID="txtUsername" runat="server" TabIndex="0" onkeypress="return Focus(window.event);"></asp:TextBox>
警报正在处理所有密钥代码,但是当我按下空格键时,例如选项卡,回车键,退格键等,则它无效。
我需要获取密码o f键盘的Tab键,这样当用户按下用户名文本框上的Tab键时,我就能专注于密码文本框。
非常感谢你提前!
Alert is working all keycode but when I press spacial key like tab, Enter,Backspace etc then it is not working.
I need to get the keycode of Tab key of keyboard so I am able to focus on password textbox when user press tab key on username textbox.
Thank you very much in advance!
推荐答案
除解决方案1外,您可能会发现对此帖的回复更有帮助在文本框中按下退格键时触发事件 [ ^ ]
Further to Solution 1, you might find the responses to this post more helpful event fired when backspace is pressed in a textbox[^]
和backspace没有任何价值。
in keypress event tab and backspace gives no value .
这篇关于登录表单中没有工作Tab键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文