Validation occurs when trying to clear a form!?

Discussion in 'ASP .Net' started by Infidel, Nov 20, 2004.

  1. Infidel

    Infidel Guest

    Hi there,

    Can anyone tell me how I can stop this from happening.

    Basically, I'm using validation controls on a form which works great... but,
    perhaps a little TOO great. When I click Clear... which is supposed to run
    a function which empties all the fields and resets lists, etc... the
    validation still kicks in and shows error messages, and the form doesn't
    clear.

    It's not until you fill in all required fields with valid info that the
    Clear Form function runs.

    What's going on, and how do i fix it?

    Thanks for any help.


    Jeremy.
    Infidel, Nov 20, 2004
    #1
    1. Advertising

  2. Infidel

    John M Deal Guest

    If your clear is behind an ASP.Net button (in its code behind event)
    you'll need to set the CausesValidation property on the button to false.
    Is this the case or is your clear routine being run on the client side?

    Have A Better One!

    John M Deal, MCP
    Necessity Software

    Infidel wrote:
    > Hi there,
    >
    > Can anyone tell me how I can stop this from happening.
    >
    > Basically, I'm using validation controls on a form which works great... but,
    > perhaps a little TOO great. When I click Clear... which is supposed to run
    > a function which empties all the fields and resets lists, etc... the
    > validation still kicks in and shows error messages, and the form doesn't
    > clear.
    >
    > It's not until you fill in all required fields with valid info that the
    > Clear Form function runs.
    >
    > What's going on, and how do i fix it?
    >
    > Thanks for any help.
    >
    >
    > Jeremy.
    >
    >
    >
    >
    John M Deal, Nov 20, 2004
    #2
    1. Advertising

  3. Hi Jeremy,

    Set the CausesValidation property of the Clear button to False. Good luck!
    Ken.


    --
    Ken Dopierala Jr.
    For great ASP.Net web hosting try:
    http://www.webhost4life.com/default.asp?refid=Spinlight
    If you sign up under me and need help, email me.

    "Infidel" <> wrote in message
    news:...
    > Hi there,
    >
    > Can anyone tell me how I can stop this from happening.
    >
    > Basically, I'm using validation controls on a form which works great...

    but,
    > perhaps a little TOO great. When I click Clear... which is supposed to

    run
    > a function which empties all the fields and resets lists, etc... the
    > validation still kicks in and shows error messages, and the form doesn't
    > clear.
    >
    > It's not until you fill in all required fields with valid info that the
    > Clear Form function runs.
    >
    > What's going on, and how do i fix it?
    >
    > Thanks for any help.
    >
    >
    > Jeremy.
    >
    >
    >
    >
    Ken Dopierala Jr., Nov 20, 2004
    #3
  4. Infidel

    Infidel Guest

    Hi Guys,


    Thanks so much for your help... it worked a treat, I thought they'd be
    something like that as it seemed to stupid a bug for this situation to
    be allowed to occur.

    I need to have a full list of Class Properties with me, as I'm using
    Dreamweaver and guess which Property does not show up in the pop-up
    context menu when editing controls... you guessed it! :p

    Thanks again for your help.

    Jeremy.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Infidel, Nov 20, 2004
    #4
    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. baroque Chou
    Replies:
    4
    Views:
    429
    Peter Blum
    Jan 24, 2006
  2. David

    Response.Clear() doesn't clear

    David, Jan 31, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    1,016
    Mark Fitzpatrick
    Jan 31, 2008
  3. TS
    Replies:
    2
    Views:
    259
    Walter Wang [MSFT]
    Jun 20, 2006
  4. InvalidLastName

    Unrecognized element 'add' after <clear></clear>

    InvalidLastName, Feb 26, 2007, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    948
    Steven Cheng[MSFT]
    Mar 6, 2007
  5. bnp
    Replies:
    4
    Views:
    320
Loading...

Share This Page