title: Form submitted even after onsubmit function returns false
body: <p>Html</p>
  
  <pre><code>&lt;form action="/users/add" onsubmit="return test();" id="UserForm" method="post" accept-charset="utf-8"&gt;
      &lt;input type="text" maxlength="255" value="" id="UserName" class="form-error"  &gt;
  &lt;/form
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>function test() {
      var inputs = $('input:not([inputname])');
  
      jQuery.each(inputs, function() {
      if (this.value == '') {
          $(this).next().removeClass('displayNone');
          return false;
      }
      });
  
  }
  </code></pre>
  
  <p>If I select single input value like below, It works fine for me. It will avoid form being submitted.</p>
  
  <pre><code>function test() {
      var value = $('#UserName').val();
      if (value == '') {
      $('#UserName').next().removeClass('displayNone');
      return false;
      }
  }
  </code></pre>
  
  <p>How to avoid form submission  when using jQuery.each  function ?</p>