将texbox值转换为大写. [英] convert texbox value to Uppercase..

查看:94
本文介绍了将texbox值转换为大写.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想将文本框"值转换为大写,并且应该以大写形式显示.

所以我只用

Hello All,

I want to Convert Textbox value into Uppercase and it should be display in uppercase.

so I have just use

<pre lang="xml"><asp:TextBox ID="txtno" runat="server" SkinID="text" MaxLength="19" onblur="this.value=this.value.toUpperCase();"></asp:TextBox>




并且我已在该文本框&上应用了RegularExpressionValidator通过Validatorcallout Extender显示错误消息,

它在IE中正常工作,但是当我在任意位置按Tab/单击时,它会显示错误消息,但textbox fullfil critria却总是显示错误消息,

请给我建议.




and I have apply RegularExpressionValidator on that textbox & display error message through Validatorcallout Extender,

its working in IE but when i press tab/click anywhere its display error message but textbox fullfil critria but its always display error message ,

Please suggest me..

<asp:RegularExpressionValidator ID="revOAHCasNo" runat="server" ControlToValidate="txtno"ErrorMessage="Please enter OAH Case No in correct format." Display="None" SetFocusOnError="true"ValidationExpression="(FM-[a-z,A-Z]{4}\-[0-9]{2}\-[0-9]{2}\-[0-9]{5})"

                                                   ValidationGroup="valgrp"></asp:RegularExpressionValidator>
 <cc1:ValidatorCalloutExtender ID="vceOAHCaseNo" runat="server" TargetControlID="revOAHCasNo"WarningIconImageUrl="../Images/Error.png"></cc1:ValidatorCalloutExtender>



推荐答案

我认为这应该有效:
I think this ought to work:
\D{3}-\D{3}
or
([A-Z]{3}\-){2}[A-Z]{4}\-\d{5}\-\d{4}


我会试试:
I would try :
<asp:RegularExpressionValidator ... ValidationExpression="^FM-[a-z,A-Z]{4}\-[0-9]{2}\-[0-9]{2}\-[0-9]{5}


" >



您在这里不需要分组功能(就像您将表达式用括号括起来一样);匹配应该在整个文本框内容上进行.因此,使用^(行或字符串的开头)和



You don''t need grouping function here (as you do when you enclose your expression in parenthesis) ; Matching is supposed to be on the entire textbox content. Thus the use of ^ (beginning of line or string) and


这篇关于将texbox值转换为大写.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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