title: Javascript Click handler only if ASP.NET client-side validation succeeds
body: <p>So basically I want to add a javascript function to a button's Click event and I only want it to execute if the form passes ASP.NET client-side validation.  </p>
  
  <p>The easiest conceptual way I can think of is to just run the validation within my function just return if it doesn't pass, but I'm not sure how to call ASP.NET's validators from javascript.</p>
  
  <p>The other way I can think of is maybe set a flag when the button is clicked, then hook into an event after the validation occurs (not sure if this is possible or how to do so) and run the function if the button click flag was set.  There is more than 1 button that causes validation which is why the flag is needed rather than just assuming the button was clicked if validation happened.</p>
  
  <p>Also open to alternative ideas.</p>
  
  <p>(Using MooTools as our JS library if that matters)</p>