Compare Validator

  • Thread starter Thread starter dotnet beginner
  • Start date Start date
D

dotnet beginner

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.
 
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.


--------------------
 
Back
Top