Breaking jQuery Loops
<p>This should be so simple, but I'm clearly missing something massively obvious here.</p>

<p>The following code should check input for either content or if it has a class and run function <code>error()</code>. This seems to be true and false and the same time, which is very confusing!</p>

<p>Any ideas what I am missing in the loop? I would have expected the <code>return false;</code> to stop the function, but it does not.</p>

<pre><code>function error() {
    jQuery("#overlay,#required").fadeIn();
    jQuery(this).addClass("error");
}

// Step 1

jQuery("#step-1-next").click(function(){

    jQuery('#step-1 .b-left input[name=name], #step-1 .b-left input[name=email], #step-1 .b-left input[name=tel], #step-1 .b-left input[name=company]').each(function() {

        if (jQuery(this).val() == '' || jQuery(this).hasClass("error")) {

            error();
            return false;   

        } else {

            // continue

        }

    });

});
</code></pre>