如何将光标放在文本框上默认? [英] How to position cursor on a text boxes default?

查看:67
本文介绍了如何将光标放在文本框上默认?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的网络应用程序中有一个文本框,登录页面有用户ID和密码。现在我希望如果页面加载,那么在输入文本框userid之后,光标应该在userid文本框上,它将转到文本框密码。这该怎么做?任何人都知道帮助我。



我尝试过:



< pre lang =c#> if (!IsPostBack)
{
UserId.Focus();
BindTextBoxvalues();
}



我试过这段代码。它仅适用于Userid。我希望如果页面加载,则在输入文本框userid后,光标应位于userid文本框上,它将转到文本框密码。

解决方案

请参见此处: 如何在HTML中控制标签顺序 [ ^ ]


Hi,
I have a textbox in my web application and having login page have user id and password. Now i want that if the page loads then cursor should be on userid textbox after entering textbox userid it goes to textbox Password. How to do this? Anyone Know help me.

What I have tried:

if (!IsPostBack)
            {
                UserId.Focus();
                BindTextBoxvalues();
            }

.
I have tried this code. It works only for Userid .I want that if the page loads then cursor should be on userid textbox after entering textbox userid it goes to textbox Password.

解决方案

See here: How to Control Tab Order in HTML[^]


这篇关于如何将光标放在文本框上默认?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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