|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
onclient click and validatorsIt seems that the onclientclick event occurs before clientside validation,
how can i make validation occur before the onclientclick? 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? 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? > > >
Finding a way to bind ASP.NET controls(two way) to a typed-dataset
Error in DataList test query - aspnet 2.0 Gridview Updates not writing to database after clicking update Datagrid paging I lose my sort Postback in Web Controls client-side .NET control Coloring Calendar !!! Dynamically Adding DataLists Combining 2 Fields Using ListBox.DataTextField Status text |
|||||||||||||||||||||||