title: Exit from a javascript function
body: <p>I saw many places similar question but couldn't fix it.</p>
  
  <p>Here's my function:</p>
  
  <pre><code>function validate_form(){
       $('#form_data input[type="text"]').each(function(){
              value = $(this).val().trim();
              if(value != '' &amp;&amp; value != null &amp;&amp; value != 0 ){
                     return true;
              }
       });
       return false;      
  }
  </code></pre>
  
  <p>Its not exiting on <code>return true;</code>. I have also tried <code>e.preventDefault()</code> but no use.</p>