Custom Validator

Discussion in 'ASP .Net Web Controls' started by Sunil Sabir, Jun 29, 2004.

  1. Sunil Sabir

    Sunil Sabir Guest

    Dear All,

    I want to use a Custom Validator which checks two things.Firstly that
    the user should only enter letters.Secondly, The text box should not
    be empty when the submit button is clicked. I know that I can do this
    by required field validator. But I want to do two things using one
    control. I have done the first part which only checks that the user
    has entered only letters.But cant figure out how to do the second part.
    which is(text box should not be empty when the submit button is
    clicked)

    Any help much appreciated.

    cheers,
    Sunil Sabir
     
    Sunil Sabir, Jun 29, 2004
    #1
    1. Advertising

  2. What you want to do can be accomplished using the regular expression
    validator.

    The regular expression to use: ^[a-zA-Z]+$


    Hope this helps.

    Jacques Leclerc

    "Sunil Sabir" <> wrote in message
    news:...
    > Dear All,
    >
    > I want to use a Custom Validator which checks two things.Firstly

    that
    > the user should only enter letters.Secondly, The text box should

    not
    > be empty when the submit button is clicked. I know that I can do

    this
    > by required field validator. But I want to do two things using one
    > control. I have done the first part which only checks that the

    user
    > has entered only letters.But cant figure out how to do the second

    part.
    > which is(text box should not be empty when the submit button is
    > clicked)
    >
    > Any help much appreciated.
    >
    > cheers,
    > Sunil Sabir
     
    Jacques Leclerc, Jun 30, 2004
    #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. Serdar Kalaycý

    Custom Validator

    Serdar Kalaycý, Jul 7, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    536
    Serdar Kalaycý
    Jul 8, 2003
  2. Mike P

    custom validator

    Mike P, Nov 5, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    353
    Mike P
    Nov 5, 2003
  3. Arvind P Rangan

    Custom Validator Issue

    Arvind P Rangan, Nov 12, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    359
  4. Replies:
    4
    Views:
    908
    Richter~9.6
    Feb 13, 2007
  5. Scott Yenor

    How to get custom control to work with custom validator

    Scott Yenor, Jan 27, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    217
    Scott Yenor
    Jan 27, 2004
Loading...

Share This Page