Can I run some custom script after ASP.NET client side page validation fails?
<p>I'm trying to run some client side script if, <em>and only if</em>, the client side Page validation fails, and can't figure out where I can hook it in.</p>

<p>If i bind my JavaScript function to the OnClientClick of the button that submits the form, it runs before the client side validation. If I bind it to the OnSubmit of the form, that only fires if the validation passes.</p>

<p>Any ideas of how or where I can hook something like this up? Or if you have other suggestions, I'm open to them.</p>

<pre><code>&lt;form id="frm" runat="server" 
     onsubmit="FUNCTION HERE WONT FIRE IF VALIDATION FAILS"&gt;
&lt;asp:requiredfieldvalidator id="vld" runat="server" controltovalidate="txt"/&gt;
&lt;asp:textbox id="txt" runat="server"&gt;&lt;/asp:textbox&gt;

&lt;asp:button id="cmd" runat="server" OnClick="dosomething"
     OnClientClick="FUNCTION FIRES BEFORE VALIDATION OCCURS"&gt;

&lt;/form&gt;
</code></pre>
