function isItOkay() { $('table[id$="gv_Detail"] tbody tr').each(function () { var $kdConnect = $(this).find("input:checkbox:checked"); var icanConnect = $(this).find("input[name$='chkConnect']"); var icantConnect = $(this).find('input[type="checkbox"][name$="chkConnect"]:checked'); var icanUnify = $(this).find('input[type="checkbox"][name$="chkUnify"]:checked'); var icanPrimary = $(this).find('input[type="checkbox"][name$="chkPrimary"]:checked'); var icanSecondary = $(this).find('input[type="checkbox"][name$="chkSecondary"]:checked'); var iConnect = $(this).find("#chkConnect").is(':checked'); var iUnify = $(this).find("#chkUnify").prop('checked'); var iPrimary = $(this).find("#chkPrimary").prop('checked'); var iSecondary = $(this).find("#chkSecondary").is(':checked'); alert("value of icanConnect - " + icanConnect.val() + "/r/n" + "value of icanUnify - " + icanUnify + "/r/n" + "value of icanPrimary - " + icanPrimary + "/r/n" + "value of icanSecondary - " + icanSecondary); }); }
<asp:GridView ID="gv_Detail" runat="server" BackColor="White" Caption="Staff Name Here" CssClass="tableXBase2" BorderColor="#3366CC" BorderStyle="Ridge" BorderWidth="1px" CellPadding="4" HorizontalAlign= "Center" AutoGenerateColumns="False" GridLines="None" OnRowDataBound="gv_KLDetail_RowDataBound" EmptyDataText="No Details for this Item" CaptionAlign="Top" Visible="false"> <columns> <asp:BoundField DataField="WFCenterName" HeaderText="Workforce Center" ItemStyle-Wrap="false" /> <asp:TemplateField HeaderText="Connect" HeaderStyle- HorizontalAlign="Center"> <itemtemplate> <asp:checkBox ID="chkConnect" runat="server" AutoPostBack="false" Checked='<%# Convert.ToBoolean(Convert.ToInt16(Eval("Connect"))) %>' Enabled='true' Text='' OnCheckedChanged="chkConnect_OnCheckedChanged"> </itemtemplate> <asp:TemplateField HeaderText="Unify" HeaderStyle- HorizontalAlign="Center"> <itemtemplate> <asp:checkBox ID="chkUnify" runat="server" AutoPostBack="false" Checked='<%# Convert.ToBoolean(Convert.ToInt16(Eval("Unify"))) %>' Enabled='true' Text='' OnCheckedChanged="chkConnect_OnCheckedChanged"> </itemtemplate> <asp:TemplateField HeaderText="Primary" HeaderStyle- HorizontalAlign="Center"> <itemtemplate> <asp:checkBox ID="chkPrimary" runat="server" AutoPostBack="false" Checked='<%# Convert.ToBoolean(Convert.ToInt16(Eval("Primary"))) %>' Enabled='true' Text='' OnCheckedChanged="chkConnect_OnCheckedChanged"> </itemtemplate> <asp:TemplateField HeaderText="Secondary" HeaderStyle-HorizontalAlign="Center"> <itemtemplate> <asp:checkBox ID="chkSecondary" runat="server" AutoPostBack="false" Checked='<%# Convert.ToBoolean(Convert.ToInt16(Eval("Secondary"))) %>' Enabled='true' Text='' OnCheckedChanged="chkConnect_OnCheckedChanged"> </itemtemplate> </columns> <footerstyle backcolor="#99CCCC" forecolor="#003399" /> <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" /> <pagerstyle backcolor="#99CCCC" forecolor="#003399" horizontalalign="Left" /> <rowstyle backcolor="White" forecolor="#003399" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)