RegularExpressionValidator - check for empty field

Discussion in 'ASP .Net' started by Oleg Ogurok, Jun 25, 2003.

  1. Oleg Ogurok

    Oleg Ogurok Guest

    Hi all,

    I want to use RegularExpressionValidator to enforce non-empty integer format
    in a TextBox. However, the validator doesn't give the error when the textbox
    is empty. For example, if ValidationExpression is \d+ or even \d{1,}, the
    validator still allows empty field. Must I use an additional
    RequiredFieldValidator?

    -Oleg.
     
    Oleg Ogurok, Jun 25, 2003
    #1
    1. Advertising

  2. If a field is empty every validator (except RequiredFieldValidator) will not
    be called.

    If a field is required AND has an expected format, you will have to include
    2 validators.

    Or you can look at writing your own composite control that has both
    validators inside it.

    bill


    "Oleg Ogurok" <> wrote in
    message news:...
    > Hi all,
    >
    > I want to use RegularExpressionValidator to enforce non-empty integer

    format
    > in a TextBox. However, the validator doesn't give the error when the

    textbox
    > is empty. For example, if ValidationExpression is \d+ or even \d{1,}, the
    > validator still allows empty field. Must I use an additional
    > RequiredFieldValidator?
    >
    > -Oleg.
    >
    >
     
    William F. Robertson, Jr., Jun 25, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shan Plourde
    Replies:
    0
    Views:
    3,087
    Shan Plourde
    Jul 19, 2004
  2. Marcia Hon

    Check if a directory is empty and empty it

    Marcia Hon, Feb 8, 2004, in forum: C Programming
    Replies:
    8
    Views:
    579
    Dave Thompson
    Feb 14, 2004
  3. ButlerDJIAM
    Replies:
    0
    Views:
    563
    ButlerDJIAM
    Nov 9, 2006
  4. amazononthemoon

    Help developing a RegularexpressionValidator for a numeric field

    amazononthemoon, May 25, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    152
    Brock Allen
    May 26, 2005
  5. king
    Replies:
    2
    Views:
    145
Loading...

Share This Page