The function always returns false if the check box is selected. I really could not hack what I am doing wrong. I use the checkbox to enable and disable the text box in gridview. However, this does not seem to work. Thanks for the help. I posted the html and jq code below.
HTML code:
<asp:GridView ID="grdFees" runat="server" AllowPaging="false" CssClass="Grid" AutoGenerateColumns="false" EmptyDataText="No Data Found" EmptyDataRowStyle-HorizontalAlign="Center" EmptyDataRowStyle-CssClass="gridItem" TabIndex="5">
<Columns>
<asp:TemplateField HeaderText="Select" HeaderStyle-HorizontalAlign="center"
ItemStyle-HorizontalAlign="center" ItemStyle-Width="2%">
<ItemTemplate>
<asp:CheckBox ID="chkselect" runat="server" CssClass="checkbox"
Width="15px" Checked="false" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
JQuery code:
$(document).ready(function()
{
$(".checkbox").click(function()
{
if ($(this).is(":checked"))
{
alert("true");
}else
{
alert("false");
}
});
source
share