title: .NET MVC - Form submit causes postback instead of onSubmit javascript execution
body: <p>i'm trying to submit my Ajax form using jQuery. However calling the submit() function causes the entire page to refresh. It should just execute the onSubmit part of the form (which returns <code>false</code> so that the page shouldn't refresh).</p>
  
  <pre><code>&lt;%Ajax.BeginForm("AllocateAndUpdateMech", 
    New With {.Controller = "Planning", 
              .Id = Model.Id}, 
              New AjaxOptions With {
                         .LoadingElementId = "loading", 
                         .UpdateTargetId = Model.Id &amp; "_alloc"}, 
              New With {.id = "allocate_" &amp; Model.Id &amp; "_" &amp; item.UserId}
  )%&gt;
  &lt;%Html.Hidden("mechId", item.UserId)%&gt;
  &lt;a href="javascript:void(0);" onclick="$('#&lt;%="allocate_" &amp; Model.Id &amp; "_" &amp; item.UserId %&gt;').submit();"&gt;Allocate: &lt;%=item.UserName%&gt;&lt;/a&gt;
  &lt;%Html.EndForm()%&gt;
  </code></pre>