title: form.submit triggers onsubmit but does not submit
body: <p>The form</p>
  
  <pre><code>&lt;form onsubmit="OnSubmitForm();" action="&lt;?php echo base_url(); ?&gt;" method="post" autocomplete="off" name="register_form" id="register_form"&gt;
  </code></pre>
  
  <p>The submit button</p>
  
  <pre><code>&lt;input id="register_submit" name="submit" class="medium" type="submit" value="Submit" onclick="document.pressed=this.value"/&gt;
  </code></pre>
  
  <p>The submit link</p>
  
  <pre><code>&lt;a href="javascript: Submit();"&gt;full registration&lt;/a&gt;
  </code></pre>
  
  <p>The Javascript/jQuery</p>
  
  <pre><code>function OnSubmitForm()
  {
    if(document.pressed == 'Full registration')
    {
        alert('full');
      document.register_form.action ="&lt;?php echo base_url(); ?&gt;account/register";
    }
    else
    if(document.pressed == 'Submit')
    {
        alert('light');
     document.register_form.action ="&lt;?php echo base_url(); ?&gt;account/register_light";
    }
  }
  
  function Submit()
  {
      document.pressed = 'Full registration';
  
      $('#register_form').submit();
  }
  </code></pre>
  
  <p>If the submit button is klicked the "light" alert is triggered and and the form is submitted to "account/register_light" as it should.</p>
  
  <p>But if the link is klicked the "full" alert is triggered but the form is not submited. More klicks on the link does not trigger the alert nor submit the form.</p>
  
  <p>If the submit buton is klicked after the link has been klicked the form is submited to "account/register"(no alert). Whitch is where i want the link to submit the form and not where de submit button usually submits the form.</p>
  
  <p>Why doesn't .submit() submit the form?
  I am confused here, any insight to what is happening wuld be greatly appreciated.</p>