Compare Validator

Discussion in 'ASP .Net' started by dotnet beginner, Nov 12, 2003.

  1. In my webform I check for dirty(textbox values changed),
    and pop up a confirm dialog box on an asp-Imagebutton
    click event.
    I wrote a javascript function (to pop up confirm box) and
    called it in the pageload event using:
    btnclick.attributes.add("onclick", "return popConfirm();")
    So far everything works absolutely fine.

    Then I added a compare validator to one of the fields in
    my form. Now, when the form is dirty (has the values in
    the textboxes changed), the confirm dialog box does not
    appear on button click event. Just don't understand why.

    Any help is appreciated.

    Thanks,
    Sudhir.
    dotnet beginner, Nov 12, 2003
    #1
    1. Advertising

  2. Hi Sudhir,

    Validation controls "take over" click events which cause validation. There
    are several workarounds. My favorite is attachEvent.

    The workarounds are described in detail at:
    http://authors.aspalliance.com/kenc/faq6.aspx

    I hope this helps.

    Thank you, Mike
    Microsoft, ASP.NET Support Professional

    Microsoft highly recommends to all of our customers that they visit the
    http://www.microsoft.com/protect site and perform the three straightforward
    steps listed to improve your computer’s security.

    This posting is provided "AS IS", with no warranties, and confers no rights.


    --------------------
    > Content-Class: urn:content-classes:message
    > From: "dotnet beginner" <>
    > Sender: "dotnet beginner" <>
    > Subject: Compare Validator
    > Date: Wed, 12 Nov 2003 13:12:26 -0800
    > Lines: 17
    > Message-ID: <053201c3a961$ac4bb370$>
    > MIME-Version: 1.0
    > Content-Type: text/plain;
    > charset="iso-8859-1"
    > Content-Transfer-Encoding: 7bit
    > X-Newsreader: Microsoft CDO for Windows 2000
    > Thread-Index: AcOpYaxLowX3UxaCSg+Aps2vu1j8NA==
    > X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    > Newsgroups: microsoft.public.dotnet.framework.aspnet
    > Path: cpmsftngxa06.phx.gbl
    > Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:190493
    > NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
    > X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >
    > In my webform I check for dirty(textbox values changed),
    > and pop up a confirm dialog box on an asp-Imagebutton
    > click event.
    > I wrote a javascript function (to pop up confirm box) and
    > called it in the pageload event using:
    > btnclick.attributes.add("onclick", "return popConfirm();")
    > So far everything works absolutely fine.
    >
    > Then I added a compare validator to one of the fields in
    > my form. Now, when the form is dirty (has the values in
    > the textboxes changed), the confirm dialog box does not
    > appear on button click event. Just don't understand why.
    >
    > Any help is appreciated.
    >
    > Thanks,
    > Sudhir.
    >
    Mike Moore [MSFT], Nov 13, 2003
    #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. Robbo
    Replies:
    0
    Views:
    314
    Robbo
    Oct 30, 2003
  2. A.M

    Compare Validator

    A.M, Jun 23, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    3,096
    scoutdickens
    Aug 23, 2007
  3. TN Bella
    Replies:
    0
    Views:
    463
    TN Bella
    Jul 2, 2004
  4. Kaja
    Replies:
    0
    Views:
    582
  5. =?Utf-8?B?U2FuZHk=?=
    Replies:
    3
    Views:
    716
    fd123456
    Feb 12, 2005
Loading...

Share This Page