Compare Validator

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

Mike Moore [MSFT]

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.


--------------------
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top