Single Validator for 3 field Phone Number

Discussion in 'ASP .Net' started by Sharon Traineanu via .NET 247, May 7, 2004.

  1. I'm using C#.net.

    I have a phone number in three asp textboxes. I'd like to make the phone number required, and validate to make sure only numbers have been entered.

    My main problem is I can't find a way to have all three textboxes use the same validator and not display 3 error messages.

    --------------------------------
    From: Sharon Traineanu

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>eZGYaPTSrUuCnHzI4El7Lg==</Id>
     
    Sharon Traineanu via .NET 247, May 7, 2004
    #1
    1. Advertising

  2. This is just not possible with the standard validation controls.
    You'll have to create your own solution.
    For this, you might find these links useful:
    http://msdn.microsoft.com/library/d...bcon/html/vbtskvalidatingprogrammatically.asp

    http://msdn.microsoft.com/library/d...n/html/vbconspecial-casevalidationresults.asp

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net



    "Sharon Traineanu via .NET 247" <> wrote in message
    news:%...
    > I'm using C#.net.
    >
    > I have a phone number in three asp textboxes. I'd like to make the phone

    number required, and validate to make sure only numbers have been entered.
    >
    > My main problem is I can't find a way to have all three textboxes use the

    same validator and not display 3 error messages.
    >
    > --------------------------------
    > From: Sharon Traineanu
    >
    > -----------------------
    > Posted by a user from .NET 247 (http://www.dotnet247.com/)
    >
    > <Id>eZGYaPTSrUuCnHzI4El7Lg==</Id>
     
    Steve C. Orr [MVP, MCSD], May 7, 2004
    #2
    1. Advertising

  3. Sharon Traineanu via .NET 247

    Peter Blum Guest

    Hi Sharon,

    Instead of writing custom code, there is a commercial solution that lets you
    do this without coding. "Professional Validation And More"
    http://www.peterblum.com/vam/home.aspx has 22 validators. Its
    MultiConditionValidator lets you combine the power of validators into a
    single validator. For example, you would be able to combine Required
    validators and DataTypeCheck validators like this:
    TextBox1 is Required AND TextBox1 must be an integer AND TextBox1 must have
    3 characters AND
    TextBox2 is Required AND TextBox2 must be an integer AND TextBox2 must have
    3 characters AND
    TextBox3 is Required AND TextBox3 must be an integer AND TextBox3 must have
    4 characters

    The result generates client-side code that is supported by IE,
    Netscape/mozilla, Opera 7, and Safari (Microsoft's validators are limited to
    DHTML browsers).

    --- Peter Blum
    www.PeterBlum.com
    Email:
    Creator of "Professional Validation And More" at
    http://www.peterblum.com/vam/home.aspx

    "Sharon Traineanu via .NET 247" <> wrote in message
    news:%...
    > I'm using C#.net.
    >
    > I have a phone number in three asp textboxes. I'd like to make the phone

    number required, and validate to make sure only numbers have been entered.
    >
    > My main problem is I can't find a way to have all three textboxes use the

    same validator and not display 3 error messages.
    >
    > --------------------------------
    > From: Sharon Traineanu
    >
    > -----------------------
    > Posted by a user from .NET 247 (http://www.dotnet247.com/)
    >
    > <Id>eZGYaPTSrUuCnHzI4El7Lg==</Id>
     
    Peter Blum, May 10, 2004
    #3
    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. Andy Eshtry
    Replies:
    1
    Views:
    886
  2. Zahoor
    Replies:
    1
    Views:
    834
    Darryl L. Pierce
    Nov 15, 2003
  3. chen selina
    Replies:
    0
    Views:
    903
    chen selina
    Jul 7, 2010
  4. Abhishek
    Replies:
    5
    Views:
    232
    David Mark
    Aug 7, 2008
  5. Rene Ivon Shamberger

    convert Phone Letters to Phone numbers

    Rene Ivon Shamberger, Dec 4, 2012, in forum: C++
    Replies:
    5
    Views:
    433
Loading...

Share This Page