title: Cancel button in mvc form
body: <p>I'm working with an mvc form that has an "edit" button, as well as a "Save" button". As of right now the "edit" button allows the user to edit the fields in the form, but I also need button that will undo any changes made and return the original information to the user. How can this be done? Thanks!</p>
  
  <pre><code>@using (Html.BeginForm("SaveAccount", "Location", FormMethod.Post, new { enctype = "multipart/form-data" }))
  { 
       some fields.....
                  &lt;button type="submit" name="EditAccount" id="EditAccount" value="Edit"&gt;Edit&lt;/button&gt;
                  &lt;button type="submit" name="SaveAccount" id="SaveAccount" value="@Model.Location.Information"&gt;Save&lt;/button&gt;
                  &lt;button type="submit" name="Cancel" id="Cancel" onclick="goBack()"&gt;Cancel&lt;/button&gt;
  }
  
  
  
   function goBack() {
      window.history.back();
  };
  </code></pre>
  
  <p>This is my last attempt at the solution.</p>