title: Submitting canceling form submit from inside second function call
body: <p>I'm trying to stop my form from submitting when the confirmation message is cancelled, but how can I cancel my form’s submission from inside the <code>each()</code>?</p>
  
  <pre><code>$('#myForm').submit(function() {
      var inputs = $(this).find('input:checked');
      inputs.each(function() {
          var inputId = $(this).attr('id');
          if(inputId != undefined &amp;&amp; inputId.substring(0, 8) == 'inputName') {
              var r = confirm("Are you sure you want to continue?");
              if (r == true) {
                  return true;
              } else {
                  // This doesn't stop the form submit
                  return false;
              }
          }
      });
  
      return true;
  });
  </code></pre>