CompareValidator not firing

Discussion in 'ASP .Net' started by MattB, Apr 5, 2005.

  1. MattB

    MattB Guest

    I have a page that has gone through a lot of editing. It has many text
    box and validator controls, and one compare validator just isn't working.
    I have the control to validate set, and control to compare set, and the
    page just behaves like the validator isn't there.
    Can anyone give me any ideas on what I need to do to make this work? It
    used to work and stopped, and I've even deleted and recreated both the
    text control and the validator using both the same and new IDs but with
    no luck. Help!

    Matt
     
    MattB, Apr 5, 2005
    #1
    1. Advertisements

  2. Hi,

    Maybe your "sumbit" controls are set to >> CausesValidation = False

    Neven
     
    Neven Klofutar, Apr 5, 2005
    #2
    1. Advertisements

  3. MattB

    MattB Guest

    Good thought, but all the other validators on the page fire (plus I
    double-checked).
    Any other ideas? It's also got Enabled=True BTW.

    Matt
     
    MattB, Apr 5, 2005
    #3
  4. MattB

    Brock Allen Guest

    A CompareValidator will only fire is something is entered into the TextBox.
    If you also require a value to be entered add a RequiredFieldValidator.
     
    Brock Allen, Apr 5, 2005
    #4
  5. MattB

    MattB Guest

    That was it (duh!). Thank you!

    Matt

     
    MattB, Apr 5, 2005
    #5
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.