Home All Groups Group Topic Archive Search About
Author
10 Nov 2005 12:33 AM
dagnar
It seems that the onclientclick event occurs before clientside validation,
how can i make validation occur before the onclientclick?

Author
10 Nov 2005 10:59 PM
Peter Blum
Instead of using onclientclick, use the <form onsubmit= > event through
Page.RegisterOnSubmitStatement(). This executes after the onclick event has
fully run. However, one challenge is that you cannot predict the order of
your code against Microsoft's validation code also inside the onsubmit
statement. Hopefully yours will come last...

FYI: I built a replacement to Microsoft's validators called Professional
Validation And More (http://www.peterblum.com/vam/home.aspx) that solves
this and so many other limitations of the original. For this case, you can
install a script into the submit process and indicate if it runs before or
after validation. If you download the trial version to explore it, see the
PeterBlum.VAM.Globals.CustomSubmitFunctionName property on page 161 of the
Validation User's Guide.

--- Peter Blum
www.PeterBlum.com
Email: PLB***@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

Show quoteHide quote
"dagnar" <dag***@discussions.microsoft.com> wrote in message
news:9EF9627D-3D20-4530-9909-C926F8D5966C@microsoft.com...
> It seems that the onclientclick event occurs before clientside validation,
> how can i make validation occur before the onclientclick?
Author
12 Nov 2005 3:36 PM
.net noobie
Peter Blum's controls are cool ;)

Show quoteHide quote
"Peter Blum" wrote:

> Instead of using onclientclick, use the <form onsubmit= > event through
> Page.RegisterOnSubmitStatement(). This executes after the onclick event has
> fully run. However, one challenge is that you cannot predict the order of
> your code against Microsoft's validation code also inside the onsubmit
> statement. Hopefully yours will come last...
>
> FYI: I built a replacement to Microsoft's validators called Professional
> Validation And More (http://www.peterblum.com/vam/home.aspx) that solves
> this and so many other limitations of the original. For this case, you can
> install a script into the submit process and indicate if it runs before or
> after validation. If you download the trial version to explore it, see the
> PeterBlum.VAM.Globals.CustomSubmitFunctionName property on page 161 of the
> Validation User's Guide.
>
> --- Peter Blum
> www.PeterBlum.com
> Email: PLB***@PeterBlum.com
> Creator of "Professional Validation And More" at
> http://www.peterblum.com/vam/home.aspx
>
> "dagnar" <dag***@discussions.microsoft.com> wrote in message
> news:9EF9627D-3D20-4530-9909-C926F8D5966C@microsoft.com...
> > It seems that the onclientclick event occurs before clientside validation,
> > how can i make validation occur before the onclientclick?
>
>
>