如何获得焦点的文本框 [英] How to get the Focus for Textbox
本文介绍了如何获得焦点的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在输入过程中如何获得文本框的焦点.如果我单击以在文本框中输入数据.该文本框将获得焦点,并将颜色从白色更改为黑色.请你能帮帮我吗?
谢谢
问候,
Snageetha
Hi,
How to get the focus for the textboxes during the entry. If i click to enter the data in textbox. That textbox get the focus and change color like white to black. Please can you help me?
Thank you,
Regards,
Snageetha
推荐答案
更改焦点上的文本框/输入背景色 [ ^ ]有点小巧可以解决您问题的文章.
Change Textbox/Input background color on focus[^] is a neat little article that should solve your problem.
将css函数添加为
Add a css function as
.focusfld
{
background-color: #FFFFCC;
}
然后在aspx页面中添加其引用,例如:
then add its reference in aspx page like:
<link href="Style/StyleSheet.css" rel="stylesheet" type="text/css" />
在aspx中将Javacript函数编写为:
Write a Javacript funtion in aspx as:
function Fun1(ctrl)
{
ctrl.className = 'focusfld';
}
并在pageLoad()中添加:
and in the pageLoad() add:
TextBox1.Attributes.Add("onFocus", "Fun1(this)");
引用类似的问题
http://stackoverflow.com/questions/5610409/css-of-a-asp- textbox-control [^ ]
还有一篇文章
http://devtoolshed.com/content/aspnet-css-highlight-textbox-focus [ ^ ]
refer similar question
http://stackoverflow.com/questions/5610409/css-of-a-asp-textbox-control[^]
and an article
http://devtoolshed.com/content/aspnet-css-highlight-textbox-focus[^]
这篇关于如何获得焦点的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文