title: MVC 3 Razor - Ajax.BeginForm OnSuccess
body: <p>I'm new to MVC and I'm trying to update my page after I submit my form; but it's not working.  I'm only trying to hide the form, and show the contents of a div OnSuccess.</p>
  
  <p>My code is:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $('#confirmation').hide();
      });
  
      function MessageConfirmation() {
          $('#confirmation').show('slow');
          $('#contactForm').hide('slow');
      }
  
  &lt;/script&gt;
  
  @using (Ajax.BeginForm("Index", new AjaxOptions { OnSuccess = "MessageConfirmation" }))
  {
  &lt;fieldset id="contactForm"&gt;
      &lt;legend&gt;Message&lt;/legend&gt;
      &lt;p&gt;
          @Html.Label("Email", "Email"): @Html.TextBox("Email")
      &lt;/p&gt;
      &lt;p&gt;
          @Html.Label("Subject", "Subject"): @Html.TextBox("Subject")
      &lt;/p&gt;
      &lt;p&gt;
          @Html.Label("Message", "Message"): @Html.TextArea("Message")
      &lt;/p&gt;
      &lt;p&gt;
          &lt;input type="submit" value="Send" /&gt;
      &lt;/p&gt;
  &lt;/fieldset&gt;
  
  &lt;p id="confirmation" onclick="MessageConfirmation()"&gt;
      Thanks!!!
  &lt;/p&gt;
  }
  </code></pre>
  
  <p>Any alternate solutions / ideas are most welcome.</p>
  
  <p>Thanks in advance!</p>