Javascript disable button event completely
<p>Hi I would like to know if its possible to do something similar to the example shown below.</p>

<pre><code>// Script A
$('.submitButton').click(function() {
   if (not valid) {
       $(this).attr("disabled", "disabled");
   }
});

// Script B
$('.submitButton').click(function() {
    // Do something else here
});
</code></pre>

<p>I would like to know whether you can actually stop the click event in <strong><em>Script B</em></strong> if not valid in <strong><em>Script A</em></strong>. The reason for the two events being separate is due to the fact that <strong><em>Script A</em></strong> will be used as a sort of a plugin module which will be inserted at the header of the page.</p>
