title: Submit checkbox state without a submit button
body: <p>I have a view with a few checkboxes that can be selected or unselected. I'd like to always register any change in a checkbox, without the use of a submit button (the user could forget to do it, and it would waste time).</p>
  
  <p>So, is there a way to handle this inside the view? Up to now, I've only used the controller to do that job.</p>
  
  <p>So, a piece of code :</p>
  
  <pre><code>  @ModelType MvcApplication.OpportuniteDetails
  
    @Code
         ViewData("Title")="Details"
    @End Code
  
    &lt;script type="text/javascript"&gt;
    $(function () {
      $(':checkbox').change(function() {
          $.ajax({
              url: '@Url.Action("update")',
              type: 'POST',
              data: { isChecked: $(this).is(':checked') },
              success: function (result) { }
          });
      });
    });
    &lt;/script&gt;
    [... Some code here...]
    @Html.Raw("Mail sent?") @Html.CheckBox(Model.Opportunite.Mail)
  
    &lt;input type="checkbox" name="mail" id="mail" onclick="test()" /&gt;
  </code></pre>