title: Why is Ajax.BeginForm not working?
body: <p>I looked at several similar questions, but I can't get it working. </p>
  
  <p>I have some radio buttons in a form. Instead of selecting the option and clicking the submit button, I want to submit the form when the user clicks a radio button. </p>
  
  <p>So I hid the submit button and placed a javascript function that emulates the click of the button (I also tried to get it working with the button click, but this doesn't seem to be the problem).</p>
  
  <p>In my View I have:</p>
  
  <pre><code>&lt;script type="text/javascript" src="/Scripts/jquery-1.9.1/jquery-1.9.1.min.js" &gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/Scripts/jquery-1.9.1/jquery.unobtrusive-ajax.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
      function change() {
          $('#buttonradio').click();
      }
  &lt;/script&gt;
  
  &lt;h2&gt;Dashboard&lt;/h2&gt;
  
  &lt;div class="Dashboard" id="itemsDshBrd" style="overflow:auto;height:97%;"&gt;
  
      &lt;div id="DshBrdRadioGroup" style="float:right;font-size:small"&gt;   
  
          &lt;% using (Ajax.BeginForm("Index", "DshBrd", new { value = 1 }, new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "stations" })) { %&gt;
  
              &lt;input class="radioclass" id="r1" name="radiogroup" type="radio" value="1" onclick="change()" checked/&gt; A
              &lt;input class="radioclass" id="r2" name="radiogroup" type="radio" value="2" onclick="change()"/&gt; B     
              &lt;input class="radioclass" id="r3" name="radiogroup" type="radio" value="3" onclick="change()"/&gt; C
              &lt;input class="radioclass" id="r4" name="radiogroup" type="radio" value="4" onclick="change()"/&gt; D
  
              &lt;input id="buttonradio" type="submit" value="Submit" style="visibility:hidden"/&gt;
  
          &lt;% } %&gt;        
  
      &lt;/div&gt;   
  
      &lt;div id="stations"&gt;
          &lt;% Html.RenderPartial("~/Views/DshBrd/Stations.ascx"); %&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>*I know that I'm sending value = 1.</p>
  
  <p>In my controller I have:</p>
  
  <pre><code>[HttpPost]
  public ActionResult Index(int value)
  {
      if (Request.IsAjaxRequest())
      {
          return PartialView("~/Views/DshBrd/Stations.aspx");
      }
  
      return View("~/Views/DshBrd/Index.aspx");
  }
  </code></pre>
  
  <p>Where <code>Request.IsAjaxRequest()</code> is never true.</p>
  
  <p>My Web.Config is also OK:</p>
  
  <pre><code>&lt;add key="ClientValidationEnabled" value="true" /&gt;
  &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
  </code></pre>
  
  <p>Any ideas?</p>