title: ASP.NET MVC - how to make users confirm the delete
body: <p>He,
  I have this page where i have checkboxes next to every item in a table, and want to allow the user to  select some of them and press my delete button. I just cant come up with the jquery for making the confirm window and submitting only if 'yes' is pushed - this is my page</p>
  
  <p></p>
  
  <pre><code>&lt;%Html.BeginForm(); %&gt;
  &lt;%List&lt;ShopLandCore.Model.SLGroup&gt; groups = (List&lt;ShopLandCore.Model.SLGroup&gt;)Model; %&gt;
  &lt;%Html.RenderPartial("AdminWorkHeader"); %&gt;
  &lt;table width="100%" id="ListTable" cellpadding="0" cellspacing="0"&gt;
      &lt;tr&gt;
          &lt;td colspan="5" class="heading"&gt;
              &lt;input type="submit" name="closeall" value="Close selected" /&gt;
              &lt;input type="submit" name="deleteall" value="Delete selected" /&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;th width="20px"&gt;
          &lt;/th&gt;
          &lt;th&gt;
              Name
          &lt;/th&gt;
          &lt;th&gt;
              Description
          &lt;/th&gt;
          &lt;th width="150px"&gt;
              Created
          &lt;/th&gt;
          &lt;th width="150px"&gt;
              Closed
          &lt;/th&gt;
      &lt;/tr&gt;
      &lt;%foreach (ShopLandCore.Model.SLGroup g in groups)
        { %&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;%=Html.CheckBox(g.Id.ToString()) %&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;%=g.Name %&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;%=g.Description %&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;%=g.Created %&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;%=g.Closed %&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;%} %&gt;
  &lt;/table&gt;
  &lt;%Html.EndForm(); %&gt;
  </code></pre>
  
  <p></p>
  
  <p>Please note that its only for the delete that it should confirm, and not necessarily for the close button.</p>