Is there a way that I can execute a Javascript function after the client side validation occurs in asp.net?
I have a couple validation controls on a page and an input button with CausesValidation=true
. The OnClientClick
handler executes Javascript before the validation runs, but i want to run some functions afterwards.
Is this possible?
The ASP.NET calls the WebForm_OnSubmit, thats runs the validation. After validation is ok, its continue and run the rest JavaScript functions that's found on onsubmit on the form.
So to execute a JavaScript after the side validation, just place it on the form tag.
For example:
<script>
function CallMeAfterValidation()
{
// here is the place to run your code
return true;
}
</script>
<form onsubmit="return CallMeAfterValidation();" runat="server" ...></form>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With