在所有文本框中更改大写. [英] Change Uppercase in all the Text Boxes.
本文介绍了在所有文本框中更改大写.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用C#.Net在特定网页的所有文本框中将大小写更改为大写?
我自己输入字母时,需要将字母更改为UpperCase.
How to change case to Uppercase in all the Text Boxes in a particular Webpage using C#.Net?
I need to Change letters to UpperCase As i type itself.
推荐答案
看看这个:
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onkeyup [ ^ ]
look at this:
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onkeyup[^]
您需要使用JavaScripttoUpperCase()
方法和onkeypress
事件来执行此操作.
网上有很多示例.这样的就是这里- http://www.effegidev.com/post/Automatic -Uppercase-Text-in-AspNet-TextBoxes.aspx [ ^ ].
相信我,搜索Google会有很大帮助!
You need to use JavaScripttoUpperCase()
method andonkeypress
event to do so.
There are plenty of examples available on the web. One such is here - http://www.effegidev.com/post/Automatic-Uppercase-Text-in-AspNet-TextBoxes.aspx[^].
Searching Google helps a lot, believe me!
您也可以尝试使用CSS
You can also try using css
<style type="text/css">
.txtUpperCase
{
/* text-transform: lowercase; /* force text to lowercase */
text-transform: uppercase; /* force text to uppercase */
/*text-transform: capitalize; /* force text to proper case */
}
</style>
将CSS类用于所有文本框
Use the css class for all text boxes
<asp:TextBox ID="tbxFirstName" runat="server" CssClass="txtupper"></asp:TextBox>
这篇关于在所有文本框中更改大写.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文