Comparing two textboxes

Discussion in 'ASP .Net' started by Steffen Loringer, Apr 26, 2004.

  1. Hi,

    I like to compare two textboxes containing double values. The second one
    should ever be bigger than the first one. How can I do this with the
    validator elements in VisualStudio.Net ?

    Thanks for help,

    Steffen
     
    Steffen Loringer, Apr 26, 2004
    #1
    1. Advertising

  2. Steffen Loringer

    Jos Guest

    Steffen Loringer wrote:
    > Hi,
    >
    > I like to compare two textboxes containing double values. The second
    > one should ever be bigger than the first one. How can I do this
    > with the validator elements in VisualStudio.Net ?


    Add a CompareValidator to the page.
    Set its ControlToValidate property to textbox 2
    Set its ControlToCompare property to textbox 1
    Set its Type property to Double
    Set its Operator property to GreaterThan

    If the values are required in both textboxes, you should also
    add RequiredFieldValidators for both textboxes, because the
    CompareValidator doesn't check this.

    --

    Jos
     
    Jos, Apr 26, 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. Greg H
    Replies:
    1
    Views:
    444
    David Waz...
    Jul 3, 2003
  2. Drew
    Replies:
    0
    Views:
    487
  3. Alphonse Giambrone

    Validation for Two Textboxes

    Alphonse Giambrone, Oct 21, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    506
    Alphonse Giambrone
    Oct 21, 2004
  4. Chris
    Replies:
    3
    Views:
    455
    Chris
    Oct 27, 2004
  5. Fred G. Sanford

    Validating two textboxes

    Fred G. Sanford, Feb 9, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    323
    Fred G. Sanford
    Feb 15, 2007
Loading...

Share This Page