Click here to Skip to main content
15,068,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I want a Regular Expression which accepts the format like
Carefully maxlength of Textbox is 5

.11
6
.6
66
06.66
6.66
66.11

Any help would be really appreciated.


Regards,
Pawan.
Posted

1 solution

Check this

XML
<pre lang="xml"><asp:TextBox ID="txtCurrencey" runat="server" MaxLength="5"></asp:TextBox>
<asp:RegularExpressionValidator ID="rgfldvalidator" ControlToValidate="txtCurrencey"
runat="server" ErrorMessage="Please enter the numbers only" ValidationExpression="^[0-9]*\.?[0-9]+$">
</asp:RegularExpressionValidator>


   
Comments
Pawan Kiran 15-Jul-10 1:58am
   
Thanks to u and It'is not working according to the sample which i have shown above in my question. ur sample code is accepting continuous 4 digits before or after the dot.The only possible chances are mentioned in my query. No other Format it should accept.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900