Avoid changing JS variable value when true value is previously set
<p>I have a javascript function that checks a textbox value and return either true or false regarding it value.</p>

<p>I have several textboxes to check:</p>

<pre><code>&lt;asp:textbox id="txt1" class="tocheck" runat="server /&gt;
&lt;asp:textbox id="txt2" class="tocheck" runat="server /&gt;
&lt;asp:textbox id="txt3" class="tocheck" runat="server /&gt;
</code></pre>

<p>and when I press the submit button (Linkbutton1) I check all their values:</p>

<pre><code>$('#LinkButton1').click(function () {
    var error = false;
    $.each($('.tocheck'), function (i, v) {
        error =  check($(v).val(), $(this));
    });
    return error;
});
</code></pre>

<p>If one of the calls return true the overall validation must be considered failed and the <code>true</code> value must be kept.</p>

<p>So what I want is prevent the error variable to be set to <code>false</code> when it's already previously set to <code>true</code>.</p>

<p>Is there any <strong>operator</strong> or <strong>function</strong> that controls this?
Thank you.</p>
