Popup window when checkbox checked in asp.net
<p>I would like to show a <code>confirmation Box</code> with the message when the user check the <code>CheckBox</code>.<br/><br/>
So i have a <code>GridView</code> and there is a column for <code>CheckBoxes</code>. <br/>
So whenever user check the <code>CheckBox</code> i would like to show a confirmation box and when user click cancel on that box i would like to uncheck that <code>CheckBox</code>.<br/>
when user press OK then i would like to fire a standard asp.net <code>CheckBox_CheckedChanged</code> where i am doing some database work.<br/>
I dont know how to do that in <code>javascript</code> or <code>Jquery</code>. <br/>
I found it on google where there is only one <code>CheckBox</code> and you can use the <code>ID</code> and using the <code>Jquery</code> you can show the popup.<br/> BUT i have a GridView and there are lots of <code>CheckBoxes</code> for each row.</p>

<p>Please suggest me some working example or Code.</p>

<p>Thanks</p>

<p><em><strong></em>**<em>*</em>**<em></strong> EDITS <strong></em>**<em>*</em>**<em>*</em>*</strong>
here is the code i have got so far.</p>

<pre><code>$('#gvOrders').click(function () {
        var checked = $(this).is(':checked');
        if (checked) {
            document.getElementById("confirm_value").value = "Yes";
            if (!confirm('Are you sure you want to mark this order as received?')) {
                $(this).removeAttr('checked');
            }
        }
        else {
            document.getElementById("confirm_value").value = "No";
            if (!confirm('Are you sure you want to mark this order as  not received?')) {
                $(this).removeAttr('checked');
        }
    });
</code></pre>

<p>This is not working so far when <code>CheckBox</code> checked. I am not sure what i am doing wrong here.</p>

<p><em><strong></em>***<em></strong> HTML FOR GRIDVIEW <strong></em>**<em>*</em>****</strong></p>

<pre><code>  &lt;asp:GridView ID="gvOrders" runat="server" AutoGenerateColumns="false" CssClass="gvClickCollectOrders"
    DataKeyNames="ac_OrderId" OnRowDataBound="gvOrders_RowDataBound" AllowPaging="true"&gt;
    &lt;Columns&gt;
        &lt;asp:BoundField DataField="ac_OrderId" Visible="false" /&gt;
        &lt;asp:BoundField DataField="ac_OrderNumber" HeaderText="Order No" DataFormatString="WWW{0}" /&gt;
         &lt;asp:TemplateField HeaderText="Order Date"&gt;
            &lt;ItemTemplate&gt;
                &lt;%# GetOrderDate(AlwaysConvert.ToInt(Eval("ac_OrderId"))) %&gt;
            &lt;/ItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="Customer Name"&gt;
            &lt;ItemTemplate&gt;
                &lt;%# Eval("CustomerFirstName") %&gt;&amp;nbsp;&lt;%# Eval("CustomerLastName") %&gt;
            &lt;/ItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="Received In Store"&gt;
            &lt;ItemTemplate&gt;
                &lt;asp:CheckBox ID="cbIsReceived" runat="server" AutoPostBack="true" Checked='&lt;%# Eval("IsReceived") %&gt;'
                    OnCheckedChanged="cbIsReceived_CheckedChanged"/&gt;
                    &lt;asp:Label ID="receivedDateText" Text="" runat="server"&gt;&lt;/asp:Label&gt;
            &lt;/ItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="Collected By Customer"&gt;
            &lt;ItemTemplate&gt;
                &lt;asp:CheckBox ID="cbIsCollected" runat="server" AutoPostBack="true" Checked='&lt;%# Eval("IsCollected") %&gt;'
                    OnCheckedChanged="cbIsCollected_CheckedChanged" /&gt;
                    &lt;asp:Label ID="collectedDateText" Text="" runat="server"&gt;&lt;/asp:Label&gt;
            &lt;/ItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
    &lt;/Columns&gt;
    &lt;EmptyDataTemplate&gt;
        &lt;asp:Label ID="emptyGrid" runat="server" Text="there are no Click and Collect orders placed for the selected store."
            CssClass="emptyGridMessage"&gt;&lt;/asp:Label&gt;
    &lt;/EmptyDataTemplate&gt;
&lt;/asp:GridView&gt;
</code></pre>
