When you have the button cause validation, how the framework does that is to
call a JavaScript to validate, and then the JavaScript submits the form. So,
it has already injected an onClick event handler, and now you are injecting
a second one, which is summarily ignored because you only get one handler
per event. In order to get both, set up one with validation, and then copy
the event handler method that is injected. Then, take validation off, run
your script, and call the validation function on the appropriate code path.
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"cksj" <ck*******@hotmail.com> wrote in message
news:eb*************@tk2msftngp13.phx.gbl...
I have a button that will trigger validators. In one special case, I have
to show a message box when the button is clicked.
In the code behind, I added the following:
cmdAccept.Attributes.Add("onclick", "javascript:checkPayment();")
The message box will not show because of the validators. It will only show
if I set CausesValidation=False on the the button. Is it possible to have
validators on the button as well as pop-up a message box on certain
situations?
thanks,
Cesar