You must Sign In to post a response.
  • Category: ASP.NET

    How to Validate like this 10.05 & 100.05

    Hello Developers,


    how i validate
    How to Validate Text box value like this 10.05 & 100.05
    Numbers and Dot only allowed.
    1.Textbox1=10.05 or xx.yy //first two digit int last two digit decimal
    2.Textbox1=100.05 or xxx.yy//first three digit int last two digit decimal
    in 1 and 2 2 secimal values is must.if there is no decimal value or no decimal value without extension of 2 it should be =(validate message) validate please enter valid decimal with extension of 2 decimal value.

    12222=incorrect.
    1.445=incorrect.
    .5555=incorect.
    333.6=incorrect.

    .33=correct
    10.23=correct.
    i have tried
    If anyone know this please tell me some idea.

    thanks with
    Paul.S
  • #763372
    Please try this. It should work.

    <code>

    <asp:TextBox ID="TextBox2" runat="server" />
    <br />
    <asp:RegularExpressionValidator ID="Regex2" runat="server" ValidationExpression="((\d+)+(\.\d+))$"
    ErrorMessage="Invalid data" ControlToValidate="TextBox2" />

    </code>


Sign In to post your comments