title: How to prevent e.preventDefault() called infinitely?
body: <pre><code>&lt;form id=&quot;form1&quot; name=&quot;form1&quot; action=&quot;/action_page.php&quot;&gt;
    &lt;label for=&quot;menu&quot;&gt;Choose option:&lt;/label&gt;
    &lt;select name=&quot;menu&quot; id=&quot;menu&quot;&gt;
      &lt;option value=&quot;option1&quot;&gt;Option 1&lt;/option&gt;
      &lt;option value=&quot;option2&quot;&gt;Option 2&lt;/option&gt;
    &lt;/select&gt;
    &lt;br&gt;&lt;br&gt;
    &lt;input type=&quot;hidden&quot; id=&quot;additional_field&quot; name=&quot;custId&quot; value=&quot;3487&quot;&gt;
    &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
  &lt;/form&gt;
  
  &lt;form id=&quot;form2&quot; name=&quot;form2&quot; action=&quot;&quot;&gt;
    &lt;label for=&quot;additional_field&quot;&gt;Additional field:&lt;/label&gt;&lt;br&gt;
    &lt;input type=&quot;text&quot; id=&quot;additional_field&quot; name=&quot;additional_field&quot; value=&quot;&quot;&gt;&lt;br&gt;
    &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
  &lt;/form&gt; 
  </code></pre>
  <p>I have 2 forms:</p>
  <ul>
  <li>form1 is the main-form</li>
  <li>form2 is hidden popup modal</li>
  </ul>
  <p>The rule:</p>
  <ul>
  <li>if visitor choose option1 at form1, just continue the form submission
  as usual. nothing to do here.</li>
  <li>If visitor choose option2 at form1, stop form1 submission and show
  form2 modal because we need additional field. after visitor fill and
  click form2 submit. we will continue the submission of form1
  including the additional_field in form2 as the additional parameter
  in form1.</li>
  <li>If visitor choose option2 at form1, the only way to submit form1 is
  when visitor click the submit button on form2.</li>
  </ul>
  <p>What is the best way jquery logic to achive this?  How to make sure e.preventDefaut not called twice when submitted from form2?</p>
  <p>I have tried this, but failed:</p>
  <pre><code>$(&quot;#form1&quot;).submit(function(e){
  
      if( $('#menu').val() == 'option2' ){
          //show modal here
         e.preventDefault();
         return false;
      }
  
  });
  $(&quot;#form2&quot;).submit(function(e){
      var additional_field = $('#additional_field').val();
      $(&quot;#form1&quot;).append('&lt;input type=&quot;hidden&quot; name=&quot;additional_field&quot; value=&quot;' + additional_field + '&quot; /&gt;')
      $('#form1').submit();
  });
  </code></pre>