Jquery form validation - return false doesn't end loop
<p>I want to validate a form so that all text input fields are filled up. To do that, I wrote below functions. But my problem is, it always shows me verified message. If I keep some field empty, it shows both empty and verified alert.</p>

<p>If you please help or suggest better method.</p>

<pre><code>function validate() {
    $("#myform :text").each(function(){
        if($.trim(this.value).length==0){
            alert("Empty!");
            return false;
        }
    });
    return 1;
}
$(document).on('click','#addnew',function() {
    if(validate() != 1){
        return false;
    }
    alert('Verified.');
});
</code></pre>
