Page postback even though validate function returns true
<p>I am using ASP.NET 4.0, JS, and Jquery for some validation. My js is throwing this error after my validation runs and returns false. It also is allowing for a post back to occur. </p>

<p>JS excerpt throwing the error:</p>

<pre><code> var eventArgs = new Sys.WebForms.EndRequestEventArgs(error, data ? data.dataItems : {}, executor);
        Sys.Observer.raiseEvent(this, "endRequest", eventArgs);
        if (error &amp;&amp; !eventArgs.get_errorHandled()) {
            throw error;
        }
</code></pre>

<p>My full error message:</p>

<pre><code>SCRIPT5022: Sys.WebForms.PageRequestManagerServerErrorException: Index was outside the bounds of the array. 
ScriptResource.axd, line 938 character 13
</code></pre>

<p>my JS:</p>

<pre><code>  if (regex) {
                result = patt.test($(this).val());
            } if (!result) {
                //return false;
                $(this).focus();
                alert("Please enter the " + failed_type + " in the following format: " + format);
                return false;
            }
</code></pre>

<p>Button:</p>

<pre><code>&lt;asp:Button ID="Update" runat="server" 
        Text="Update" CssClass="button" 
        TabIndex="4" OnClientClick="return update_Click(event);" OnClick="Update_Click" /&gt; 
</code></pre>

<p>Call Stack:</p>

<pre><code>PageRequestManager$_endPostback,ScriptResource.axd line 938
PageRequestManager$_parseDelta,ScriptResource.axd line 1653
PageRequestManager$_onFormSubmitCompleted,ScriptResource.axd line 1414
Anonymous Function, ScriptResource.axd, line627
Anonymous function, ScriptResource.axd, line 4337
raise, ScriptResource.axd, line 7247 
WebRequest$completed, ScriptResource.axd, line 7251
WebRequest$completed, ScriptResource.axd, line 7251 
</code></pre>
